From ed15b2c737bffc83008c694f01ad693ddbdd974a Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 25 Aug 2021 22:34:14 +0000 Subject: Run collectstatic in the image build process, disable in prod startup --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 5594b458..3e0ebbb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,13 @@ ENV GIT_SHA=$git_sha # Copy the source code in last to optimize rebuilding the image COPY . . +# Set dummy variables so collectstatic can load settings.py +RUN \ + SECRET_KEY=dummy_value \ + DATABASE_URL=postgres://localhost \ + METRICITY_DB_URL=postgres://localhost \ + python manage.py collectstatic + # Run web server through custom manager ENTRYPOINT ["python", "manage.py"] CMD ["run"] -- cgit v1.2.3