fix postgres backup (#30)

<!--
Thank you for doing recipe maintenance work!
Please mark all checklist items which are relevant for your changes.
Please remove the checklist items which are not relevant for your changes.
Feel free to remove this comment.
-->

* [x] I have deployed and tested my changes
* [x] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash)
* [x] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes)
* [x] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes)

Info for release notes:

> Up until now the backups only worked sporadically, as they used the database volume and not the dump due to wring path. Upgrading to this version will start produce reliable backups. Older backups cannot be restored with backup bot anymore, and should be copied manually. (In case there is a working one)

Reviewed-on: https://git.coopcloud.tech/coop-cloud/loomio/pulls/30
Reviewed-by: Jackie Makdah <jackiemak22@proton.me>
Co-authored-by: stevensting <stefan@klasse-methode.it>
Co-committed-by: stevensting <stefan@klasse-methode.it>
This commit is contained in:
stevensting
2026-07-17 11:08:45 +00:00
committed by stevensting
parent fe7aa8d879
commit 86fd81a825
3 changed files with 82 additions and 6 deletions
+11 -6
View File
@@ -115,12 +115,14 @@ services:
PGDATA: /pgdata
deploy:
labels:
backupbot.backup: "${ENABLE_BACKUPS:-true}"
backupbot.backup.pre-hook: sh -c 'pg_dump -U "$$POSTGRES_USER" -Fc "$$POSTGRES_DB" | gzip > "/postgres.dump.gz"'
backupbot.backup.path: "/postgres.dump.gz"
backupbot.backup.post-hook: "rm -f /postgres.dump.gz"
backupbot.restore: "true"
backupbot.restore.post-hook: sh -c 'gzip -d /postgres.dump.gz && pg_restore --clean -U "$$POSTGRES_USER" --dbname="$$POSTGRES_DB" < /postgres.dump && rm -f /postgres.dump'
backupbot.backup: ${ENABLE_BACKUPS:-true}
backupbot.backup.volumes.pgdata.path: "backup.sql"
backupbot.backup.pre-hook: "/pg_backup.sh backup"
backupbot.restore.post-hook: '/pg_backup.sh restore'
configs:
- source: pg_backup
target: /pg_backup.sh
mode: 0555
redis:
image: redis:8.0
networks:
@@ -203,6 +205,9 @@ configs:
entrypoint:
name: ${STACK_NAME}_entrypoint_${LOOMIO_ENTRYPOINT_VERSION}
file: entrypoint.sh
pg_backup:
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
file: pg_backup.sh
secrets:
devise_secret: