add backup label

This commit is contained in:
Moritz 2023-10-19 23:41:49 +02:00
parent 9a6f96952b
commit 3d21efaa48
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,11 @@ services:
start_period: 1m
rallly_db:
image: postgres:14.8
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat /run/secrets/db_password) pg_dump -U postgres $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
backupbot.backup.post-hook: "rm -rf /var/lib/postgresql/data/backup.sql"
volumes:
- db-data:/var/lib/postgresql/data
secrets: