Back up the database automatically on every compose up

A one-shot backup service runs before the app starts (depends_on
service_completed_successfully; compose re-runs exited one-shots on
every up), so the plain docker compose pull + up -d update flow always
snapshots the database first. Uses SQLite's online-backup API via
better-sqlite3 from the app image itself - safe against the live WAL
database, no downtime, no extra tooling. Backups land in ./backups
(newest 14 kept); a failed backup blocks the app from starting rather
than updating without a safety net.
This commit is contained in:
2026-08-30 13:43:22 +02:00
parent b361fb2687
commit 48c7a55bbd
2 changed files with 33 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
node_modules/
/data/
/backups/
*.db
*.sqlite
.env