diff --git a/README.md b/README.md index dc2e344..d0f8673 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ cp .env.example .env docker compose up --build ``` +This starts the development-oriented topology (source bind mounts enabled). + 3. If `AUTO_APPLY_MIGRATIONS=0`, run migrations manually: ```bash @@ -91,6 +93,32 @@ docker compose exec web python manage.py createsuperuser - Health: http://localhost/health/ - API root endpoints: `/api/players/`, `/api/competitions/`, `/api/teams/`, `/api/seasons/` +## Development vs Release Compose + +Development startup (mutable source, HTMX/Tailwind workflow): + +```bash +docker compose up --build +``` + +Release-style startup (immutable runtime containers, no source bind mount in web/celery runtime): + +```bash +docker compose -f docker-compose.yml -f docker-compose.release.yml up -d --build +``` + +Optional release-style stop: + +```bash +docker compose -f docker-compose.yml -f docker-compose.release.yml down +``` + +Notes: + +- In release-style mode, `web`, `celery_worker`, and `celery_beat` run from the built image filesystem. +- `tailwind` is marked as `dev` profile in release override and is not started unless `--profile dev` is used. +- `nginx`, `postgres`, and `redis` service naming remains unchanged. + ## Setup and Run Notes - `web` service starts through `entrypoint.sh` and waits for PostgreSQL readiness. @@ -120,6 +148,14 @@ docker compose exec web python manage.py createsuperuser This keeps persistent state outside container lifecycles. +In release-style mode, these volumes remain the persistence layer: + +- `postgres_data` for database state +- `static_data` for collected static assets served by nginx +- `media_data` for uploaded/provider media +- `runtime_data` for Celery beat schedule/runtime files +- `redis_data` for Redis persistence + ## Migrations Create migration files: diff --git a/docker-compose.release.yml b/docker-compose.release.yml new file mode 100644 index 0000000..1223faa --- /dev/null +++ b/docker-compose.release.yml @@ -0,0 +1,28 @@ +services: + web: + volumes: + - static_data:/app/staticfiles + - media_data:/app/media + - runtime_data:/app/runtime + environment: + DJANGO_SETTINGS_MODULE: config.settings.production + DJANGO_DEBUG: "0" + + celery_worker: + volumes: + - runtime_data:/app/runtime + environment: + DJANGO_SETTINGS_MODULE: config.settings.production + DJANGO_DEBUG: "0" + + celery_beat: + volumes: + - runtime_data:/app/runtime + environment: + DJANGO_SETTINGS_MODULE: config.settings.production + DJANGO_DEBUG: "0" + + tailwind: + profiles: + - dev +