Add release compose override without source bind mounts
This commit is contained in:
36
README.md
36
README.md
@ -72,6 +72,8 @@ cp .env.example .env
|
|||||||
docker compose up --build
|
docker compose up --build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This starts the development-oriented topology (source bind mounts enabled).
|
||||||
|
|
||||||
3. If `AUTO_APPLY_MIGRATIONS=0`, run migrations manually:
|
3. If `AUTO_APPLY_MIGRATIONS=0`, run migrations manually:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -91,6 +93,32 @@ docker compose exec web python manage.py createsuperuser
|
|||||||
- Health: http://localhost/health/
|
- Health: http://localhost/health/
|
||||||
- API root endpoints: `/api/players/`, `/api/competitions/`, `/api/teams/`, `/api/seasons/`
|
- 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
|
## Setup and Run Notes
|
||||||
|
|
||||||
- `web` service starts through `entrypoint.sh` and waits for PostgreSQL readiness.
|
- `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.
|
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
|
## Migrations
|
||||||
|
|
||||||
Create migration files:
|
Create migration files:
|
||||||
|
|||||||
28
docker-compose.release.yml
Normal file
28
docker-compose.release.yml
Normal file
@ -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
|
||||||
|
|
||||||
Reference in New Issue
Block a user