Skip to content

Commit 5a01bf1

Browse files
feat(main) pi5 endpoint
1 parent a708bfc commit 5a01bf1

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Dockerfile.raspberrypi5

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
ARG NODEJS_VERSION="16.19.1"
2+
3+
#FROM balenalib/raspberrypi3-debian-node:${NODEJS_VERSION}-bookworm-run
4+
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node:${NODEJS_VERSION}-bookworm-run
5+
6+
7+
# install required packages
8+
RUN install_packages \
9+
chromium-common \
10+
chromium \
11+
lsb-release \
12+
scrot
13+
14+
WORKDIR /usr/src/app
15+
16+
# install node dependencies
17+
COPY ./package.json /usr/src/app/package.json
18+
RUN JOBS=MAX npm install --unsafe-perm --production && npm cache clean --force
19+
20+
COPY ./src /usr/src/app/
21+
22+
RUN chmod +x ./*.sh
23+
24+
RUN mkdir -p /etc/chromium/policies
25+
RUN mkdir -p /etc/chromium/policies/recommended
26+
COPY ./policy.json /etc/chromium/policies/recommended/my_policy.json
27+
28+
# Add chromium user
29+
RUN useradd chromium -m -s /bin/bash -G root || true && \
30+
groupadd -r -f chromium && id -u chromium || true \
31+
&& chown -R chromium:chromium /home/chromium || true
32+
33+
COPY ./public-html /home/chromium
34+
35+
# udev rule to set specific permissions
36+
RUN echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules
37+
RUN usermod -a -G audio,video,tty chromium
38+
39+
RUN ln -s /usr/bin/chromium /usr/bin/chromium-browser || true
40+
41+
# Set up the audio block. This won't have any effect if the audio block is not being used.
42+
RUN curl -skL https://raw.githubusercontent.com/balena-labs-projects/audio/master/scripts/alsa-bridge/debian-setup.sh| sh
43+
ENV PULSE_SERVER=tcp:audio:4317
44+
45+
COPY VERSION .
46+
ENV DISPLAY=:0
47+
# Start app
48+
RUN sed -i -e 's/\r$//' /usr/src/app/start.sh
49+
CMD ["bash", "/usr/src/app/start.sh"]

0 commit comments

Comments
 (0)