add backup label

This commit is contained in:
Moritz 2023-10-19 23:47:50 +02:00
parent 3072d4c33c
commit 928469f6eb
1 changed files with 5 additions and 0 deletions

View File

@ -62,6 +62,11 @@ services:
db:
image: postgres:9.5
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat /run/secrets/db_password) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
backupbot.backup.post-hook: "rm -rf /var/lib/postgresql/data/backup.sql"
environment:
POSTGRES_DB: onlyoffice
POSTGRES_USER: onlyoffice