Pin the base image, publish to GHCR, and watch it with Dependabot - #1
Merged
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014TnDappY3DcbhiFS1BgKGW
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014TnDappY3DcbhiFS1BgKGW
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.
Context
This repo builds Railway's Postgres image with
pg_cronadded.pg_cronruns the Inngestrun/trace retention job (
ops/inngest-prune.sqlin the monorepo), which is the only thingbounding those trace stores.
Only staging consumes this repo today, and it does so by building from source. Dev and prod
still run the stock
ghcr.io/railwayapp-templates/postgres-ssl:17.Problem / What's broken
Two issues, found on 2026-08-06.
Dev and prod are one container replacement away from a database that will not boot.
pg_cronwas apt-installed inside their running containers, on 2026-06-08 and 2026-06-19respectively, confirmed by dpkg mtimes sitting long after the base image packages. That
splits the install across two lifetimes:
shared_preload_libraries = pg_stat_statements,pg_cronlives in
postgresql.confinside PGDATA on the volume, whilepg_cron.solives only in thecontainer filesystem. Any redeploy, image change, or platform restart gives a container
without the library while the config still demands it, and Postgres refuses to start with
FATAL: could not access file "pg_cron".Consuming this repo as a repo build costs database recognition. Staging builds from
source, and Railway no longer treats it as a database: no Data tab, and
railway connectanswers
No supported database found in service. Dev and prod are image-sourced and keep it.The base tag was also pinned to
17.6while prod runs17.10. Pointing a 17.10 datadirectory at a 17.6 binary is a minor-version downgrade, which PostgreSQL does not guarantee.
What this PR changes
Dockerfile-17: base bumped17.6->17.10, matching what prod runs. Header explainswhy the extension is baked in and the two rules for merging a Dependabot bump.
.github/workflows/build.yml: builds and pushesghcr.io/fountain-bio/postgres:17plusa
17-<sha>tag for rollback. Pull requests build without publishing. A final step assertspg_cron.soandpg_cron.controlexist in the built image, so a base image that drops orrenames the package fails the build rather than a database.
.github/dependabot.yml: weeklydockerandgithub-actionsupdates. Dependabot'sdocker fetcher matches any filename containing "dockerfile" (
DOCKER_REGEXPindependabot-core), so
Dockerfile-17is covered without a rename.Why we're making this change
Baking
pg_croninto a published image makes container replacement survivable, and consumingit as a Source Image rather than a repo build keeps Railway's database features. Pinning
the base gives Dependabot something to bump, so Postgres minor releases arrive as reviewable
PRs instead of drifting silently under a floating tag.
How to test
Verified locally before opening this:
docker build --platform linux/amd64 -f Dockerfile-17 .succeeds on the pinned base.postgres (PostgreSQL) 17.10 (Debian 17.10-1.pgdg13+1), an exactmatch for prod's running version.
/usr/lib/postgresql/17/lib/pg_cron.soand/usr/share/postgresql/17/extension/pg_cron.controlare both present.
After merge, CI publishes the image. Then per service, change Source Image and leave the
source type as image:
ghcr.io/fountain-bio/postgres:17. Confirm the Data tab opens,railway connectworks, and Postgres starts with
shared_preload_librariesintact.The GHCR package has to be pullable by Railway. Make it public, or add registry credentials on
each service.
Rollout / Risk notes
Image is changed.
that loses
pg_cron.soand stops Postgres from starting. Moving to this image is what makesredeploys safe again.
proven the swap keeps database recognition.
minor version a live data directory runs.
🤖 Generated with Claude Code
https://claude.ai/code/session_014TnDappY3DcbhiFS1BgKGW