chore: rename postgres service to db

This commit is contained in:
bisco
2026-06-24 09:10:18 +02:00
parent 6dd508aa9c
commit 4886516aa3
6 changed files with 22 additions and 10 deletions
+7 -3
View File
@@ -12,7 +12,7 @@ stores content, and Docker Compose supplies a reproducible local environment.
Italian fallback content for development when the CMS is unavailable.
- `nginx/`: reverse-proxy virtual host for `azionelab.org`, routing public requests to
Astro or Wagtail.
- `postgres`: persistent CMS database.
- `db`: persistent PostgreSQL database.
- Docker volumes: `postgres_data` for the database and `media_data` for uploads.
See [the architecture document](docs/architecture.md),
@@ -91,11 +91,15 @@ The frontend reads `PUBLIC_CMS_API_URL`; inside Compose it defaults to
public reverse-proxy address. Change both values for another environment.
The standard published-page endpoint is also available at `/api/v2/pages/`.
The PostgreSQL service is named `db`. Existing `.env` files should replace `@postgres:`
with `@db:` in `DATABASE_URL`; a compatibility network alias keeps older local values
working during the transition.
## Useful commands
```bash
# Follow application logs
docker compose logs -f postgres backend frontend proxy
docker compose logs -f db backend frontend proxy
# Run database migrations
docker compose exec backend python manage.py migrate
@@ -137,7 +141,7 @@ Database rows and uploaded files must be backed up together:
```bash
mkdir -p backups/media
docker compose stop frontend backend
docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' > backups/database.sql
docker compose exec -T db sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' > backups/database.sql
docker compose cp backend:/app/media/. backups/media/
docker compose start backend frontend
```