diff --git a/compose.postgres.yml b/compose.postgres.yml index ab36200..02fd6f2 100644 --- a/compose.postgres.yml +++ b/compose.postgres.yml @@ -27,6 +27,12 @@ services: interval: 10s timeout: 5s retries: 5 + deploy: + labels: + backupbot.backup: "true" + backupbot.backup.pre-hook: "mkdir -p /tmp/backup/ && PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup/backup.sql" + backupbot.backup.post-hook: "rm -rf /tmp/backup" + backupbot.backup.path: "/tmp/backup/" volumes: - postgres: \ No newline at end of file + postgres: