generated from bisco/codex-bootstrap
chore: rename postgres service to db
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user