-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.x64
78 lines (64 loc) · 1.74 KB
/
Dockerfile.x64
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
74
75
76
77
78
#
# AlarmDecoder web application
#
# http://github.com/tenstartups/alarmdecoder-webapp
#
FROM alpine:latest
LABEL maintainer="Marc Lennox <[email protected]>"
# Set environment variables.
ENV \
PAGER=more \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
TERM=xterm-color
# Install packages.
RUN \
apk --update add \
bsd-compat-headers \
build-base \
curl-dev \
dosfstools \
git \
libffi-dev \
libressl-dev \
libxml2-dev \
libxslt-dev \
linux-headers \
pcre-dev \
python \
python-dev \
py2-pip \
sqlite \
sudo \
zlib-dev && \
rm -rf /var/cache/apk/*
# Install python packages.
RUN \
pip install gunicorn --upgrade
# Create the required user.
RUN \
addgroup alarmdecoder && \
adduser -D -s /bin/sh alarmdecoder -G alarmdecoder
# Set the working directory.
WORKDIR /opt/alarmdecoder-webapp
# Install the alarmdecoder web application
RUN \
git clone https://github.com/nutechsoftware/alarmdecoder-webapp.git . && \
pip install -r requirements.txt && \
pip install -e git://github.com/nutechsoftware/alarmdecoder.git@master#egg=alarmdecoder && \
mkdir instance && \
chown -R alarmdecoder:alarmdecoder .
# Initialize the application database
RUN \
su alarmdecoder -c 'python manage.py initdb'
# Add files to the container.
COPY entrypoint.sh /docker-entrypoint
# Set the entrypoint script.
ENTRYPOINT ["/docker-entrypoint"]
# Create data volume.
VOLUME /opt/alarmdecoder-webapp/instance
# Expose the default alarmdecoder port.
# Note that we need to run this image with --net=host so this port is unimportant.
EXPOSE 5000
# Set the default command.
CMD ["gunicorn", "-u", "alarmdecoder", "-g", "alarmdecoder", "-b", "unix:/tmp/gunicorn.sock", "wsgi:application"]