Backup-Sidecar: täglicher pg_dump scharf geschaltet

Das dokumentierte Backup lief real nie (stock postgres-Image ohne Cron,
backup.sh nirgends eingebunden) -> bei Volume-/Disk-Verlust drohte Totalverlust.

- Neuer service "backup" (docker-compose.yml): postgres:16-alpine als Sidecar,
  taeglicher pg_dump um BACKUP_HOUR (Default 03:00 Europe/Berlin)
- backup-loop.sh: abhaengigkeitsfreier Tages-Scheduler (umgeht busybox-cron-
  Environment-Eigenheiten)
- backup.sh korrigiert: laeuft remote gegen PGHOST mit PGPASSWORD; -Fc statt
  "-Fc | gzip" (war doppelt komprimiert und als .sql.gz nicht restore-bar) -> .dump
- BACKUP_HOUR/BACKUP_RETENTION_DAYS konfigurierbar (.env.example)
- operations.md: Backup-/Restore-Anleitung an Ist-Zustand angepasst

Verifiziert: pg_dump erstellt + pg_restore in frische DB, Daten intakt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Raffael SheikhandClaude Opus 4.8 committed 2026-06-07 11:09:38 +02:00
1 parent 39e259f3ac
commit 7285ed9cae
5 files changed
+95 -13

No files matched your search

+5
View File
@@ -17,6 +17,11 @@ SESSION_COOKIE_SECRET=please-change-me-in-prod-at-least-32-chars
# --- Cron Bearer (Story 2.6 + 5.1 + 6.3) ---
CRON_BEARER_TOKEN=please-change-me-in-prod
# --- Backup-Sidecar (Story 6.3, nur Prod) ---
# Täglicher pg_dump im service "backup". Beide optional (Defaults: 03 / 14).
# BACKUP_HOUR=03
# BACKUP_RETENTION_DAYS=14
# --- App ---
NODE_ENV=development
LOG_LEVEL=info