diff --git a/deployment/compose/docker-compose.yml b/deployment/compose/docker-compose.yml index c1f765d..29285f1 100644 --- a/deployment/compose/docker-compose.yml +++ b/deployment/compose/docker-compose.yml @@ -19,6 +19,27 @@ services: - .env command: "granian --interface wsgi hanz.wsgi:application --host 0.0.0.0 --port 8000 \ --workers 2 --threads 2 --log-level info" + + static_build: + build: + context: ../../ + dockerfile: Dockerfile + container_name: hanz_prod_static_build + networks: + - hanz-nw + depends_on: + - db + - redis + environment: + - DATABASE_URL=postgres://user:dbpassword@db:5432/hanz-db + - REDIS_URL=redis://redis:6379/1 + env_file: + - .env + volumes: + - ./static:/app/src/static/ + command: "poetry run python manage.py collectstatic --noinput --clear && \ + poetry run python manage.py collectstatic --noinput && \ + poetry run python manage.py compress --force" db: image: postgres:15-alpine