-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.template
More file actions
68 lines (56 loc) · 2.21 KB
/
Copy pathDockerfile.template
File metadata and controls
68 lines (56 loc) · 2.21 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
67
68
# This dockerfile is specifically generated to target a raspberry pi platform and will not run on different host architectures
# Balena base image reference: https://www.balena.io/docs/reference/base-images/base-images/
# Device type pulled based on template variable for targeted fleet. Note that Fleets must share a similar architecture.
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node
# Avoid debconf from asking about keyboard config - there is no keyboard - set debconf to noninteractive
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
clang \
xserver-xorg-core \
xserver-xorg-input-all \
xserver-xorg-video-fbdev \
xorg \
libxcb-image0 \
libxcb-util1 \
xdg-utils \
libdbus-1-3 \
libgtk-3-0 \
# libnotify-dev \
# libgnome-keyring-dev \
# libgconf2-dev \
libasound2 \
libcap2 \
# libcups2-dev \
# libxtst-dev \
libxss1 \
libnss3 \
# libsmbclient \
libssh-4 \
fbset \
# libexpat-dev \
# libraspberrypi-bin \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
# Set local timezone for device
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set Xorg and FLUXBOX preferences
RUN mkdir ~/.fluxbox
RUN echo "xset s off" > ~/.fluxbox/startup && echo "xserver-command=X -s 0 dpms" >> ~/.fluxbox/startup
RUN echo "#!/bin/bash" > /etc/X11/xinit/xserverrc \
&& echo "" >> /etc/X11/xinit/xserverrc \
&& echo 'exec /usr/bin/X -s 0 dpms -nocursor -nolisten tcp "$@"' >> /etc/X11/xinit/xserverrc
# Move package.json to filesystem
COPY ./package.json .
RUN npm install --production --force && npm cache clean --force && rm -rf /tmp/*
# Test to ensure that electron was installed by checking if the electron binaries were downloaded to the /dist/ folder
RUN test -d "./node_modules/electron/dist/" || exit 1
COPY . .
## uncomment if you want systemd
ENV INITSYSTEM on
# Workarounds for dealing with chromium's sandbox requirements. This (below) didn't seem to work, but setting "--no-sandbox" on the start script did
# https://github.com/electron/electron/issues/17972
# RUN chmod 4755 node_modules/electron/dist/chrome-sandbox
# Start app
CMD ["bash", "/usr/src/app/start.sh"]