-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile.template
41 lines (32 loc) · 1.27 KB
/
Dockerfile.template
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
FROM resin/%%RESIN_MACHINE_NAME%%-node:6
# Install other apt deps
RUN apt-get update && apt-get install -y \
xserver-xorg-core \
xserver-xorg-input-all \
xserver-xorg-video-fbdev \
xorg \
fluxbox \
python-imaging-tk \
unzip \
cron && rm -rf /var/lib/apt/lists/*
# 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
# Defines our working directory in container
WORKDIR /usr/src/app
# Copies the package.json first for better cache on later pushes
COPY package.json package.json
# This install npm dependencies on the resin.io build server,
# making sure to clean up the artifacts it creates in order to reduce the image size.
RUN JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*
# This will copy all files in our root to the working directory in the container
COPY . ./
# Install cronjobs to turn display on and off
RUN crontab jobs.txt
# Enable systemd init system in container
ENV INITSYSTEM on
# Start app
CMD ["bash", "/usr/src/app/start.sh"]