From f4a7dad7a77ed848289e591a763b2e611c2f4819 Mon Sep 17 00:00:00 2001 From: Alex Mikhankov Date: Sat, 26 Apr 2025 21:59:48 +0000 Subject: [PATCH] fix: collect static files during container startup --- docker-compose.prod.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index ee09b2d9..d305393d 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -5,7 +5,9 @@ services: build: context: ./app dockerfile: Dockerfile.prod - command: gunicorn hello_django.wsgi:application --bind 0.0.0.0:8000 + command: > + sh -c "python manage.py collectstatic --noinput && + gunicorn hello_django.wsgi:application --bind 0.0.0.0:8000" volumes: - static_volume:/home/app/web/staticfiles - media_volume:/home/app/web/mediafiles