Skip to content

Commit

Permalink
Move to COMPRESS_OFFLINE for multiple replicas
Browse files Browse the repository at this point in the history
This generates a compress-manifest.json which is used to
determine which file hashes are in use as apparently they
are not consistent.
  • Loading branch information
frankwiles committed Aug 28, 2024
1 parent e2f61de commit c00cccf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ services:
context: .
target: release
tty: true
working_dir: /nuremberg
command: python manage.py runserver 0.0.0.0:8000
working_dir: /code
# command: python manage.py runserver 0.0.0.0:8000
ports:
- "127.0.0.1:8000:8000"
volumes:
# BIND MOUNTS
- ./web:/nuremberg
- ./web:/code
- ./media:/media
environment:
# let Django load Docker-specific settings conditionally
- DOCKERIZED=True
- DEBUG=True
- DEBUG=False
- SECRET_KEY=top-secret-1234
- LOCAL_DEVELOPMENT=True
- DJANGO_VITE_DEV_MODE=True
- LOCAL_DEVELOPMENT=False
- DJANGO_VITE_DEV_MODE=False
depends_on:
- solr
stop_signal: SIGKILL
Expand Down
5 changes: 4 additions & 1 deletion web/nuremberg/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@
#
COMPRESS_PRECOMPILERS = (('text/less', 'lessc {infile} {outfile}'),)

COMPRESS_STORAGE = 'compressor.storage.GzipCompressorFileStorage'
COMPRESS_STORAGE = 'compressor.storage.OfflineManifestFileStorage'
COMPRESS_OFFLINE = True
COMPRESS_OFFLINE_MANIFEST = 'compress-manifest.json'

# whitenoise settings
# https://warehouse.python.org/project/whitenoise/
Expand Down Expand Up @@ -244,6 +246,7 @@
SECRET_KEY = 'supersecret'
DEBUG = True
COMPRESS_ENABLED = True
COMPRESS_FORCE = False

CACHES = {
'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}
Expand Down

0 comments on commit c00cccf

Please sign in to comment.