forked from apptension/django-restauth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (30 loc) · 1.04 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
##
# Chamber installation stage
##
FROM segment/chamber:2 AS chamber
##
# App build stage
##
FROM python:3.8-slim-buster AS backend_build
ENV PYTHONUNBUFFERED 1
ENV PIP_NO_CACHE_DIR off
RUN apt-get update && apt-get install -y --no-install-recommends postgresql-client ca-certificates jq \
&& update-ca-certificates \
&& pip install --no-cache-dir setuptools pipenv==2018.11.26 gunicorn \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
COPY --from=chamber /chamber /bin/chamber
WORKDIR /app
COPY Pipfile* /app/
RUN pipenv install --dev --system --deploy
COPY . /app/
RUN chmod +x /app/scripts/*.sh
FROM backend_build AS static_files
ENV HASHID_FIELD_SALT='' \
DJANGO_PARENT_HOST='' \
DJANGO_SECRET_KEY='build' \
DB_CONNECTION='{"dbname":"build","username":"build","password":"build","host":"db","port":5432}'
RUN python manage.py collectstatic --no-input
FROM backend_build AS backend
COPY --from=static_files /app/static /app/static
CMD ["./scripts/run.sh"]