Skip to content
Permalink
Browse files
Fixes #1269 - Moving collectstatic out of Dockerfile (#1285)
  • Loading branch information
jonespm committed Jul 8, 2021
1 parent 7eff037 commit 0ab3c2c0d3f9f551334fc0390d0da4fd60c36fab
Showing with 4 additions and 5 deletions.
  1. +2 −1 dashboard/settings.py
  2. +1 −2 dockerfiles/Dockerfile
  3. +1 −2 dockerfiles/Dockerfile.openshift
@@ -13,6 +13,7 @@
import json, os
from typing import Tuple, Union

from django.core.management.utils import get_random_secret_key
from django.utils.module_loading import import_string

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
@@ -70,7 +71,7 @@
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ENV.get('DJANGO_SECRET_KEY')
SECRET_KEY = ENV.get('DJANGO_SECRET_KEY', get_random_secret_key())

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = ENV.get('DJANGO_DEBUG', True)
@@ -55,8 +55,7 @@ COPY --from=node-prod-deps /usr/src/app/node_modules node_modules
# NOTE: project files likely to change between dev builds
COPY . .

# This DJANGO_SECRET_KEY is set here just so collectstatic runs with an empty key. It can be set to anything
RUN echo yes | DJANGO_SECRET_KEY="collectstatic" python manage.py collectstatic --verbosity 0
RUN python manage.py collectstatic --verbosity 0 --noinput

# Sets the local timezone of the docker image
ARG TZ
@@ -54,8 +54,7 @@ COPY --from=node-prod-deps /usr/src/app/node_modules node_modules
# NOTE: project files likely to change between dev builds
COPY . .

# This DJANGO_SECRET_KEY is set here just so collectstatic runs with an empty key. It can be set to anything
RUN echo yes | DJANGO_SECRET_KEY="collectstatic" python manage.py collectstatic --verbosity 0
RUN python manage.py collectstatic --verbosity 0 --noinput

# Sets the local timezone of the docker image
ARG TZ

0 comments on commit 0ab3c2c

Please sign in to comment.