-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathDockerfile.template
More file actions
66 lines (47 loc) · 1.9 KB
/
Copy pathDockerfile.template
File metadata and controls
66 lines (47 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM debian:13
ENV DEBIAN_FRONTEND=noninteractive
# Install the necessary packages
COPY ./build /usr/src/build
RUN chmod a+x /usr/src/build/install_chromium
RUN /usr/src/build/install_chromium "%%BALENA_MACHINE_NAME%%"
# Install node
WORKDIR /usr/local
# renovate: datasource=node-version depName=node
ARG NODE_VERSION=22.21.1
RUN curl "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-$(dpkg --print-architecture | sed -e 's/amd/x/' -e 's/armhf/armv7l/').tar.gz" \
| tar xz --strip-components=1 \
&& ./bin/node --version
# renovate: datasource=npm depName=npm
ARG NPM_VERSION=11.6.3
# install npm
RUN npm install -g "npm@${NPM_VERSION}" \
&& rm -rf /root/.npm/_cacache \
&& npm cache clear --force \
&& rm -rf /tmp/*
WORKDIR /usr/src/app
# install node dependencies
COPY ./package.json /usr/src/app/package.json
RUN JOBS=MAX npm install --unsafe-perm --production \
&& rm -rf /root/.npm/_cacache \
&& npm cache clear --force \
&& rm -rf /tmp/*
COPY ./src /usr/src/app/
RUN chmod +x ./*.sh
ENV UDEV=1
RUN mkdir -p /etc/chromium/policies
RUN mkdir -p /etc/chromium/policies/recommended
COPY ./policy.json /etc/chromium/policies/recommended/my_policy.json
# Add chromium user
RUN useradd chromium -m -s /bin/bash -G root || true && \
groupadd -r -f chromium && id -u chromium || true \
&& chown -R chromium:chromium /home/chromium || true
COPY ./public-html /home/chromium
# udev rule to set specific permissions
RUN echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules
RUN usermod -a -G audio,video,tty chromium
# Set up the audio block. This won't have any effect if the audio block is not being used.
RUN curl -skL https://raw.githubusercontent.com/balena-labs-projects/audio/master/scripts/alsa-bridge/debian-setup.sh| sh
ENV PULSE_SERVER=tcp:audio:4317
COPY VERSION .
# Start app
CMD ["bash", "/usr/src/app/start.sh"]