forked from grahamgilbert/Crypt-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (42 loc) · 1.26 KB
/
Dockerfile
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
FROM python:3.10.8-alpine3.16
LABEL maintainer="graham@grahamgilbert.com"
ENV APP_DIR /home/docker/crypt
ENV DEBUG false
ENV LANG en
ENV TZ Etc/UTC
ENV LC_ALL en_US.UTF-8
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
gcc \
git \
openssl-dev \
build-base \
libffi-dev \
libc-dev \
musl-dev \
linux-headers \
pcre-dev \
postgresql-dev \
xmlsec-dev \
tzdata \
postgresql-libs \
libpq
COPY setup/requirements.txt /tmp/requirements.txt
RUN set -ex \
&& 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"]