aboutsummaryrefslogtreecommitdiffstats
path: root/docker/app/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'docker/app/Dockerfile')
-rw-r--r--docker/app/Dockerfile42
1 files changed, 42 insertions, 0 deletions
diff --git a/docker/app/Dockerfile b/docker/app/Dockerfile
new file mode 100644
index 00000000..93d0c378
--- /dev/null
+++ b/docker/app/Dockerfile
@@ -0,0 +1,42 @@
+FROM bitnami/python:3.7-prod
+
+STOPSIGNAL SIGQUIT
+ARG EXTRAS=deploy
+
+RUN adduser \
+ --disabled-login \
+ --no-create-home \
+ --uid 1500 \
+ pysite
+
+RUN apt-get update -y \
+ && \
+ apt-get install --no-install-recommends -y \
+ gcc \
+ libc-dev \
+ libpq-dev \
+ && \
+ apt-get clean \
+ && \
+ rm -rf /var/lib/apt/lists/*
+
+WORKDIR /app
+
+COPY Pipfile Pipfile.lock /app/
+
+RUN rm -r /opt/bitnami/python/lib/python3.*/site-packages/setuptools* && \
+ pip install --no-cache-dir -U setuptools
+
+RUN python3 -m pip install pipenv \
+ && python3 -m pipenv install --dev --system --deploy
+
+COPY . .
+
+RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// python3 manage.py collectstatic --no-input --clear --verbosity 0
+
+RUN apt-get purge -y \
+ gcc \
+ libc-dev \
+ libpq-dev
+
+CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]