Skip to content

Commit

Permalink
Fixes tl-its-umich-edu#1269 - Moving collectstatic out of Dockerfile (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonespm authored Jul 8, 2021
1 parent 7eff037 commit 0ab3c2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dashboard/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions dockerfiles/Dockerfile.openshift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ab3c2c

Please sign in to comment.