forked from grahamgilbert/Crypt-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (37 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
48 lines (37 loc) · 1.37 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
FROM python:3.7.2-alpine3.7
LABEL maintainer="graham@grahamgilbert.com"
ENV APP_DIR /home/docker/crypt
ENV DEBUG false
ENV LANG en_US
ENV TZ America/New_York
COPY setup/requirements.txt /tmp/requirements.txt
# This is gross, but needed until we get pip patched in the upstream image
RUN LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "pip install --upgrade pip==19.0.3"
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
gcc \
git \
libffi-dev \
libc-dev \
musl-dev \
linux-headers \
pcre-dev \
postgresql-dev \
xmlsec-dev \
&& LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "pip install --no-cache-dir -r /tmp/requirements.txt" \
&& rm /tmp/requirements.txt
COPY / $APP_DIR
COPY docker/settings.py $APP_DIR/fvserver/
COPY docker/settings_import.py $APP_DIR/fvserver/
COPY docker/gunicorn_config.py $APP_DIR/
COPY docker/django/management/ $APP_DIR/server/management/
COPY docker/run.sh /run.sh
RUN chmod +x /run.sh \
&& mkdir -p /home/app \
&& ln -s ${APP_DIR} /home/app/crypt
WORKDIR ${APP_DIR}
# don't use this key anywhere else, this is just for collectstatic to run
RUN export FIELD_ENCRYPTION_KEY="jKAv1Sde8m6jCYFnmps0iXkUfAilweNVjbvoebBrDwg="; python manage.py collectstatic --noinput; export FIELD_ENCRYPTION_KEY=""
EXPOSE 8000
VOLUME $APP_DIR/keyset
CMD ["/run.sh"]