Repository navigation
feat: Docker image on GHCR for scheduled backups on your own server - #55
Merged
Merged
Conversation
- Dockerfile builds the CLI from this repo's source on node 24 alpine, with pg_dump/pg_restore/psql 17 (same major as the GitHub Action), runs as the non-root node user, and has no credentials in it: config is env-only - BACKUPDRILL_CRON runs `backupdrill backup` on that schedule via supercronic (TZ honoured, no overlapping runs); without it the container runs one backup and exits; arguments go straight to the CLI. An invalid schedule exits 64 at start - workflow builds and smoke-tests the image on PRs, and on main pushes ghcr.io/backupdrill/backupdrill:latest, :<version>, :sha-<commit> for amd64 and arm64 - README: Docker section
…ublish only from main
…says overlapping runs are skipped
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a container image so backups can run on a home server, NAS or Unraid box instead of GitHub Actions.
Dockerfile: builds the CLI from this repo's source onnode:24-alpine3.24, withpg_dump/pg_restore/psql17 (same major as the GitHub Action; a pg_dump 18 archive can't be read by pg_restore 17). Runs as the non-rootnodeuser. No credentials in the image; config is env-only, sameBACKUPDRILL_*variables as the CLI.docker/entrypoint.sh: withBACKUPDRILL_CRONset, supercronic runsbackupdrill backupon that schedule (honoursTZ, skips a run while the previous one is still going). Without it, one backup and exit with the CLI's exit code. Arguments go straight to the CLI. Only a standard 5-field expression or an@shortcut is accepted; anything else exits 64 at start, becausesupercronic -testalone accepts comments,VAR=valuelines and0 3 * * * foo, which would leave the container running without a backup job..github/workflows/docker-image.yml: on PRs, builds and smoke-tests (version matches package.json, pg_dump 17, bad schedules exit 64, missing config fails fast). Onmainonly, pushesghcr.io/backupdrill/backupdrill:latest,:<version>,:sha-<commit>for amd64 and arm64.Tested locally (OrbStack): one-shot backup and
* * * * *scheduled backup against Postgres 17 into an S3-compatible bucket, both✓ Backup complete;docker stopexits cleanly in under a second; valid/invalid schedule matrix.Known limit, not handled: a calendar-impossible schedule such as
0 0 31 2 *passes validation and supercronic then logs warnings in a loop. Catching it needs a cron evaluator; out of scope here.