Parent PRD
#242
What to build
Implement automated daily PostgreSQL backups satisfying NFR-004 (RPO < 24 hours). The docker-compose.prod.yml already declares a postgres_backups volume (/var/backups/postgresql) — this slice adds the backup service that actually writes to it.
This slice covers:
- Add a
db-backup service to deployment/docker-compose.prod.yml using a standard PostgreSQL backup image (e.g., prodrigestivill/postgres-backup-local or equivalent)
- Connects to the
postgres service using the same credentials
- Runs daily
pg_dump on a configurable schedule (default: 02:00 daily)
- Writes compressed backup files to the existing
postgres_backups volume
- Retains the last 7 daily backups; older files are pruned automatically
- Restarts
unless-stopped to survive host reboots
- The backup container is on
menlo-network and waits for postgres to be healthy before running
deployment/README.md updated with:
- How to verify a backup ran (check backup file listing in the volume)
- How to restore from a backup (
pg_restore or psql command against the backup file)
- How to configure the backup schedule and retention via environment variables
Acceptance criteria
Blocked by
User stories addressed
From PRD #242 (specification NFR-004):
NFR-004 — Backup: Automated daily backups must be performed to a separate local storage location. RPO < 24 hours.
Parent PRD
#242
What to build
Implement automated daily PostgreSQL backups satisfying NFR-004 (RPO < 24 hours). The
docker-compose.prod.ymlalready declares apostgres_backupsvolume (/var/backups/postgresql) — this slice adds the backup service that actually writes to it.This slice covers:
db-backupservice todeployment/docker-compose.prod.ymlusing a standard PostgreSQL backup image (e.g.,prodrigestivill/postgres-backup-localor equivalent)postgresservice using the same credentialspg_dumpon a configurable schedule (default: 02:00 daily)postgres_backupsvolumeunless-stoppedto survive host rebootsmenlo-networkand waits forpostgresto be healthy before runningdeployment/README.mdupdated with:pg_restoreorpsqlcommand against the backup file)Acceptance criteria
db-backupservice exists indeployment/docker-compose.prod.ymlpostgres_backupsvolumepostgresbeing healthy before runningdeployment/README.mddocuments how to verify a backup existsdeployment/README.mddocuments how to restore from a backup filepodman compose up/docker compose upBlocked by
User stories addressed
From PRD #242 (specification NFR-004):