forked from Screenly/Anthias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
73 lines (58 loc) · 2.46 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
73
FROM resin/%%RESIN_MACHINE_NAME%%-debian
MAINTAINER Anton Molodykh <[email protected]>
RUN apt-get update && \
apt-get -y install \
build-essential \
curl \
git-core \
libffi-dev \
libssl-dev \
matchbox \
net-tools \
nginx-light \
omxplayer \
psmisc \
python-dev \
python-imaging \
python-netifaces \
python-simplejson \
sqlite3 \
uzbl \
x11-xserver-utils \
xserver-xorg && \
apt-get clean
RUN rm /etc/nginx/sites-enabled/default
COPY ansible/roles/ssl/files/nginx_resin.conf /etc/nginx/sites-enabled/screenly.conf
# Install Python requirements
ADD requirements.txt /tmp/requirements.txt
RUN curl -s https://bootstrap.pypa.io/get-pip.py | python && \
pip install --upgrade -r /tmp/requirements.txt
# Screenly Websocker Server
COPY ansible/roles/screenly/files/screenly-websocket_server_layer.service /etc/systemd/system/screenly-websocket_server_layer.service
RUN sed -i '/\[Service\]/ a\Environment=HOME=/data' /etc/systemd/system/screenly-websocket_server_layer.service
# Screenly Server
COPY ansible/roles/screenly/files/screenly-web.service /etc/systemd/system/screenly-web.service
RUN sed -i '/\[Service\]/ a\Environment=HOME=/data' /etc/systemd/system/screenly-web.service
RUN sed -i '/\[Service\]/ a\Environment=Environment=LISTEN=0.0.0.0' /etc/systemd/system/screenly-web.service
RUN sed -i '/\[Service\]/ a\Environment=Environment=SWAGGER_HOST=ose.demo.screenlyapp.com' /etc/systemd/system/screenly-web.service
# X11
COPY ansible/roles/screenly/files/X.service /etc/systemd/system/X.service
# Matchbox
COPY ansible/roles/screenly/files/matchbox.service /etc/systemd/system/matchbox.service
#Screenly Viewer
COPY ansible/roles/screenly/files/screenly-viewer.service /etc/systemd/system/screenly-viewer.service
RUN sed -i '/\[Service\]/ a\Environment=HOME=/data' /etc/systemd/system/screenly-viewer.service
RUN sed -i '/\[Service\]/ a\Environment=DISABLE_UPDATE_CHECK=True' /etc/systemd/system/screenly-viewer.service
# Enable container init system.
ENV INITSYSTEM on
# Create runtime user
RUN useradd pi -d /home/pi \
&& /usr/sbin/usermod -a -G video pi
# Install config file and file structure
RUN mkdir -p /home/pi/screenly
COPY ansible/roles/screenly/files/gtkrc-2.0 /home/pi/.gtkrc-2.0
# Copy in code base
COPY . /home/pi/screenly
RUN chown -R pi:pi /home/pi
WORKDIR /home/pi/screenly
CMD ["bash", "bin/start_resin.sh"]