aboutsummaryrefslogtreecommitdiffstats
path: root/docker/app/local.Dockerfile
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2019-09-21 22:14:46 +1000
committerGravatar scragly <[email protected]>2019-09-21 22:14:46 +1000
commite8854540c6d70618d2148d8c1a9d2384502096b1 (patch)
tree917d559be3e5179f234e3f67fd352393e4ac0de1 /docker/app/local.Dockerfile
parentUse a .whl for `wiki` package instead of git repo. (diff)
Change back to official python base image, remove git pkg
Diffstat (limited to '')
-rw-r--r--docker/app/local.Dockerfile22
1 files changed, 10 insertions, 12 deletions
diff --git a/docker/app/local.Dockerfile b/docker/app/local.Dockerfile
index 2c95cea3..e53e300f 100644
--- a/docker/app/local.Dockerfile
+++ b/docker/app/local.Dockerfile
@@ -1,27 +1,25 @@
-FROM bitnami/python:3.7-prod
+FROM python:3.7-slim
+# Allow service to handle stops gracefully
STOPSIGNAL SIGQUIT
+# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_NOSPIN=1
-# Create a user.
+# Create non-root user
RUN useradd --system --shell /bin/false --uid 1500 pysite
-# Install prerequisites needed to complete the dependency installation.
-RUN install_packages git gcc libc-dev libpq-dev
-
-# Copy the project files into the working directory.
+# Copy the project files into working directory
WORKDIR /app
COPY . .
-# Update setuptools by removing egg first, add other dependencies
-RUN rm -r /opt/bitnami/python/lib/python3.*/site-packages/setuptools* && \
- pip install -U setuptools
-RUN pip install pipenv uwsgi
-RUN pipenv install --system --deploy
+# Install project dependencies
+RUN pip install -U pipenv pyuwsgi && pipenv install --system --deploy
-RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// python3 manage.py collectstatic --no-input --clear --verbosity 0
+# Prepare static files for site
+RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// \
+ python3 manage.py collectstatic --no-input --clear --verbosity 0
CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]