From 79259eb856ea2847a61c44dee4eb03f557a7e4f1 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Sun, 10 Oct 2021 14:42:40 +0300 Subject: Merges Dockerfiles Merges the normal dockerfile with the static build one to reduce duplication. Signed-off-by: Hassan Abouelela --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 046e7f80..2b039fab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,12 @@ RUN \ METRICITY_DB_URL=postgres://localhost \ 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 ; \ +fi + # Run web server through custom manager ENTRYPOINT ["python", "manage.py"] CMD ["run"] -- cgit v1.2.3