fix(backup) + chore: upgrade to 1.3.0+6.42.0-alpine

- Inline mysqldump/gunzip into backupbot.backup.pre-hook and
  backupbot.restore.post-hook label values on the db service.
  Single-file gzipped dump (--single-transaction --routines
  --triggers --databases ghost) is written into the mysql volume
  at /var/lib/mysql/backup.sql.gz; the volume is what backupbot
  snapshots, so the dump survives the round-trip and the restore
  hook re-imports it. Replaces the previous mysqldump --tab
  backup that shipped with no restore hook (silent data loss on
  restore, since the mysql data volume itself wasn't backed up).
- Drop mysql_backup.sh, its config mount, and MYSQL_BACKUP_VERSION
  in favour of the inline label pattern used by
  akaunting / engelsystem / forgejo.
- Raise app healthcheck start_period 1m -> 15m to accommodate
  slow fresh-DB migration on first boot.
- Upgrade ghost image to 6.42.0-alpine; bump recipe version to
  1.3.0+6.42.0-alpine.
This commit is contained in:
notplants
2026-06-02 17:29:23 +00:00
committed by notplants
parent ff03db348f
commit b38837c099
2 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
services: services:
app: app:
image: ghost:6.21.2-alpine image: ghost:6.42.0-alpine
environment: environment:
# see https://ghost.org/docs/config/#configuration-options # see https://ghost.org/docs/config/#configuration-options
database__client: mysql database__client: mysql
@ -51,13 +51,13 @@ services:
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.permanent=true" - "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.permanent=true"
- "backupbot.backup=true" - "backupbot.backup=true"
- "backupbot.backup.path=/var/lib/ghost/content" - "backupbot.backup.path=/var/lib/ghost/content"
- "coop-cloud.${STACK_NAME}.version=1.2.0+6.21.2-alpine" - "coop-cloud.${STACK_NAME}.version=1.3.0+6.42.0-alpine"
healthcheck: healthcheck:
test: ["CMD", "wget", "--header=X-Forwarded-Proto: https", "--spider", "-q", "http://localhost:2368/ghost/api/admin/site"] test: ["CMD", "wget", "--header=X-Forwarded-Proto: https", "--spider", "-q", "http://localhost:2368/ghost/api/admin/site"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 10 retries: 10
start_period: 1m start_period: 15m
db: db:
image: mysql:8.0 image: mysql:8.0
@ -72,9 +72,9 @@ services:
deploy: deploy:
labels: labels:
- "backupbot.backup=true" - "backupbot.backup=true"
- "backupbot.backup.pre-hook=mysqldump -u root -p\"$$(cat /run/secrets/db_password)\" ghost --tab /var/lib/mysql-files/" - 'backupbot.backup.pre-hook=mysqldump -u root -p"$$(cat /run/secrets/db_password)" --single-transaction --routines --triggers --databases ghost | gzip > /var/lib/mysql/backup.sql.gz'
- "backupbot.backup.post-hook=rm -rf /var/lib/mysql-files/*" - "backupbot.backup.volumes.mysql.path=backup.sql.gz"
- "backupbot.backup.path=/var/lib/mysql-files/" - 'backupbot.restore.post-hook=gunzip -c /var/lib/mysql/backup.sql.gz | mysql -u root -p"$$(cat /run/secrets/db_password)"'
healthcheck: healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p\"$$(cat /run/secrets/db_password)\""] test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p\"$$(cat /run/secrets/db_password)\""]