Skip to content

Commit 42cce22

Browse files
mattstrattonclaude
andcommitted
Run collectstatic at container startup
The Docker volume for staticfiles persists across deploys, so baked-in static files from the image get overridden by the old volume contents. Running collectstatic at startup ensures the volume always has the latest files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b3c9fa2 commit 42cce22

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docker-compose.prod.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ services:
22
web:
33
image: ghcr.io/devopsdays/devopsdays-web-app:latest
44
command: >
5-
sh -c "python manage.py migrate --noinput &&
5+
sh -c "python manage.py collectstatic --noinput &&
6+
python manage.py migrate --noinput &&
67
gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3 --timeout 120"
78
volumes:
89
- media_files:/app/media

0 commit comments

Comments
 (0)