feat(deploy): nightly database backups with verified restore (M7)
A backup container dumps the database every night, keeps 14 daily and 8 weekly copies and once a week restores a copy into a scratch database to check tables and row counts. update.sh takes a copy before updating, restore.sh brings one back and keeps the old database aside. CI runs the dump, verify and restore cycle on the database the end-to-end journey filled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d91ff89c64
commit
aacf55679a
7 files changed
+250
-3
No files matched your search
@@ -142,6 +142,26 @@ services:
|
||||
interval: 5s
|
||||
retries: 20
|
||||
|
||||
# Ежедневная копия базы и еженедельная проверка восстановления (deploy/backup.sh, docs/deployment.md#бэкапы).
|
||||
backup:
|
||||
<<: *restart
|
||||
image: pgvector/pgvector:0.8.7-pg17
|
||||
entrypoint: ["bash", "/backup.sh"]
|
||||
command: ["loop"]
|
||||
environment:
|
||||
PGHOST: postgres
|
||||
PGUSER: pipu
|
||||
PGPASSWORD: ${POSTGRES_PASSWORD}
|
||||
PGDATABASE: pipu
|
||||
BACKUP_HOUR: ${BACKUP_HOUR:-3}
|
||||
BACKUP_KEEP_DAILY: ${BACKUP_KEEP_DAILY:-14}
|
||||
BACKUP_KEEP_WEEKLY: ${BACKUP_KEEP_WEEKLY:-8}
|
||||
volumes:
|
||||
- ./backup.sh:/backup.sh:ro
|
||||
- ${PIPU_DATA:-/srv/pipu}/backups:/backups
|
||||
depends_on:
|
||||
postgres: { condition: service_healthy }
|
||||
|
||||
redis:
|
||||
<<: *restart
|
||||
image: redis:7.4-alpine
|
||||
|
||||
Reference in new issue
Block a user