aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile17
1 files changed, 5 insertions, 12 deletions
diff --git a/Dockerfile b/Dockerfile
index 2b039fab..454e58d5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,21 +1,14 @@
-FROM --platform=linux/amd64 python:3.9-slim-buster
+FROM ghcr.io/chrislovering/python-poetry-base:3.10-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 \
- POETRY_VIRTUALENVS_CREATE=false
-
-# Install poetry
-RUN pip install -U poetry
-
# Copy the project files into working directory
WORKDIR /app
# Install project dependencies
COPY pyproject.toml poetry.lock ./
-RUN poetry install --no-dev
+RUN poetry install --without dev
# Set Git SHA environment variable
ARG git_sha="development"
@@ -34,14 +27,14 @@ RUN \
SECRET_KEY=dummy_value \
DATABASE_URL=postgres://localhost \
METRICITY_DB_URL=postgres://localhost \
- python manage.py collectstatic --noinput --clear
+ poetry run python manage.py collectstatic --noinput --clear
# Build static files if we are doing a static build
ARG STATIC_BUILD=false
RUN if [ $STATIC_BUILD = "TRUE" ] ; \
- then SECRET_KEY=dummy_value python manage.py distill-local build --traceback --force ; \
+ then SECRET_KEY=dummy_value poetry run python manage.py distill-local build --traceback --force ; \
fi
# Run web server through custom manager
-ENTRYPOINT ["python", "manage.py"]
+ENTRYPOINT ["poetry", "run", "python", "manage.py"]
CMD ["run"]