Compare commits

..

5 Commits

Author SHA1 Message Date
26ef5e6625 refactor(backup): inline backupbot hooks, drop mysql_backup.sh
All checks were successful
cc-ci/testme cc-ci: success
Move the mysqldump/gunzip commands directly into the
backupbot.backup.pre-hook / backupbot.restore.post-hook label values
on the db service and delete the external mysql_backup.sh + its
config mount + MYSQL_BACKUP_VERSION. Matches the inline pattern used
by akaunting / engelsystem / forgejo and removes one file from the
recipe surface area.
2026-06-02 17:04:02 +00:00
fefff0d643 chore: upgrade to 1.3.0+6.42.0-alpine
All checks were successful
cc-ci/testme cc-ci: success
2026-06-02 02:04:59 +00:00
ae43ffe340 fix(healthcheck): raise app start_period 1m->15m (slow fresh-DB migration)
Ghost's fresh-DB first boot runs a full schema migration (dozens of CREATE
TABLEs, each a separate MySQL round-trip; ~6-9min on a small/slow node). The
1m start_period + 10x30s retries (~6min grace) is too tight there: swarm marks
the still-migrating task unhealthy and kills it mid-migration, leaving a stale
migrations_lock row so every later task deadlocks (MigrationsAreLockedError).

start_period only widens the startup grace window: a healthy check still marks
the task healthy immediately, so fast hosts are unaffected. It cannot be exposed
as an env var (abra validates the literal compose 'duration' format BEFORE env
substitution, rejecting ${VAR} / "${VAR:-1m}" with FATA 'Does not match format
duration'), so a literal bump is the only way to widen it.
2026-05-30 17:18:13 +01:00
6d6227f7ba fix(backup): use volume-relative backup path (backupbot restores it) + drop rm post-hook
backupbot restores backed-up files by volume; an absolute backup.path is not mapped back into the
volume on restore, so the restore.post-hook reimported a missing dump. Use
backupbot.backup.volumes.mysql.path=backup.sql.gz (mirrors the postgres recipes).
2026-05-30 05:42:00 +00:00
a1e95fcbcd fix(backup): single-file mysqldump backup + reimport-on-restore hook
The previous recipe backed the DB up as a mysqldump --tab into /var/lib/mysql-files with NO restore
hook (and the mysql data volume itself was not backupbot-labelled), so a restored backup silently
kept the live, un-restored DB state — data loss on restore. Add mysql_backup.sh (backup: gzipped
mysqldump --databases ghost into the data volume; restore: reimport it) wired via backupbot
backup.pre-hook + restore.post-hook, mirroring the postgres recipes (mattermost-lts, immich). Bump
1.2.0 -> 1.3.0.
2026-05-30 04:58:53 +00:00
2 changed files with 8 additions and 8 deletions

View File

@ -1 +1 @@
export GHOST_ENTRYPOINT_VERSION=v1
export GHOST_ENTRYPOINT_VERSION=v1

View File

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