added backup
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
stevensting 2025-02-09 20:28:16 +01:00
parent 3587172e5f
commit 7581ab7ecf
2 changed files with 12 additions and 3 deletions

View File

@ -4,10 +4,10 @@
<!-- metadata -->
* **Category**: Apps
* **Status**: 0, work-in-progress
* **Image**: [`loomio/*`](https://hub.docker.com/r/loomio)
* **Status**: 3, work-in-progress
* **Image**: [`loomio/*`](https://hub.docker.com/r/loomio), 4, upstream
* **Healthcheck**: Yes
* **Backups**: No
* **Backups**: Yes
* **Email**: Outgoing yes, incoming no
* **Tests**: No
* **SSO**: No

View File

@ -71,6 +71,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=0.6.0+v2.25.2"
- "backupbot.backup=true"
worker:
image: loomio/loomio:v2.25.2
configs:
@ -105,6 +106,14 @@ services:
environment:
<<: *db-env
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'
redis:
image: redis:5.0
networks: