waitfordb: initial tool + container + CI #1
Reference in New Issue
Block a user
Delete Branch "benvin/initial"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
A reusable wait-for-DB init container so we stop hand-writing psql-in-a-shell init containers (e.g. the arrstack sonarr/radarr/prowlarr deployments). Env-configured, generic across Postgres/MySQL.
How
SELECT 1succeeds (server+auth+db all ready), then exit 0; exit 1 on timeout, 2 on config error.WAITFORDB_*env with libpqPG*fallback (precedence DSN > WAITFORDB_* > PG*); configurableTIMEOUT/INTERVAL/CONNECT_TIMEOUT; password redacted in logs.patch|minor|majorrelease. Woodpecker: build-check on PR/push, publishdocker-internal/waitfordbonv*tag.Branch protection to be added once CI is green.
Genericised the docs per feedback: removed the 'replaces the hand-written psql-in-a-shell initContainers we used on the arrstack (sonarr/radarr/prowlarr)' line and swapped the example log/initContainer names to generic placeholders (appdb / app-db / postgres-rw.default.svc). The README now stands on its own with no references to other projects or past history.