This repository has been archived by the owner on Apr 20, 2022. It is now read-only.
forked from balena-io-experimental/balena-octoprint
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile.template
72 lines (60 loc) · 1.65 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
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
69
70
71
72
###
# Build stage
##
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:latest-build as build
ARG octodash_version=7570c46a22e15635329b06879cfe934599599064
RUN echo "arch=$(uname -m)" > ~/.npmrc
# Move to app dir
WORKDIR /usr/src/app
# Install build dependencies
RUN install_packages \
apt-utils \
clang \
libxcb-image0 \
libxcb-util0 \
xdg-utils \
libdbus-1-dev \
libgtk2.0-dev \
libnotify-dev \
libgnome-keyring-dev \
libgconf2-dev \
libasound2-dev \
libcap-dev \
libcups2-dev \
libxtst-dev \
libxss1 \
libnss3-dev \
libsmbclient \
libssh-4 \
libexpat-dev \
git
# Clone project to filesystem, checkout octodash_version and remove git index to save space
RUN git clone https://github.com/UnchartedBull/OctoDash.git && cd OctoDash && git checkout $octodash_verion && rm -rf .git
# Install npm modules for the application and compile
RUN cd OctoDash && npm install && npm run ng:build
###
# Runtime
##
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:latest-run
RUN echo "arch=$(uname -m)" > ~/.npmrc
# Move to app dir
WORKDIR /usr/src/app
# Install runtime dependencies
RUN install_packages \
xserver-xorg-core \
xserver-xorg-input-all \
xserver-xorg-video-fbdev \
xorg \
libgtk3.0 \
libnss3 \
libxss1 \
libasound2 \
jq
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
# Copy the app from the build step
COPY --from=build /usr/src/app/OctoDash /usr/src/app/OctoDash
COPY ./start.sh /usr/src/app/start.sh
COPY config.json /root/.config/octodash/config.json
CMD ["bash","/usr/src/app/start.sh"]