fix(deploy): mount the Postgres 18 volume where the image expects it - #1397
Merged
iammukeshm merged 1 commit intoSep 26, 2026
Merged
Conversation
postgres:18 keeps PGDATA under /var/lib/postgresql/18/docker and refuses a mount at /var/lib/postgresql/data even on an empty volume, so docker compose up restart-looped Postgres and never started the migrator or the API on a fresh machine.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Sep 25, 2026
Member
|
Thanks, verified — the 18+ image rejects the old mount even on an empty volume. Merging. We'll call out the empty-volume-on-upgrade note in the v10 release notes. |
iammukeshm
approved these changes
Sep 26, 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.
docker compose upfromdeploy/dockernever gets past Postgres on a fresh machine. The compose file runspostgres:18-alpinewith the data volume mounted at/var/lib/postgresql/data, and the 18+ images refuse that layout outright, even on an empty volume:The container restarts in a loop, so
migratorandapi(which wait onpostgres: service_healthy) never start. It has been this way since the image moved to 18 in52f87d7f(2026-06-04). I hit it while walking the full stack for the i18n PRs.Change
deploy/docker/docker-compose.yml: mountpg_dataat/var/lib/postgresql, which is what the 18+ images expect (they keepPGDATAin/var/lib/postgresql/18/docker). One comment explains why.deploy/docker/postgres-init/01-create-databases.sql: the header comment named the old path.Nothing else changes: same image, same volume name, same init script.
Verified
Fresh volume, Postgres service only, under a separate compose project so no other stack was touched:
origin/main:unhealthy, restarting, with the log above.healthy. The init script ran (pg_trgm,pgcrypto,uuid-osspare present infsh), and the data directory is/var/lib/postgresql/18.I also ran the whole compose stack with this mount (migrator, API, both front-ends), and it came up.
Existing volumes
An existing
pg_datavolume does not carry over through this change, and it could not before it either: a volume created by Postgres 17 or earlier has to be dumped and restored (orpg_upgraded) to run on 18, whatever the mount point. With this change, an old volume mounted at the new path is not read, and Postgres initializes a fresh cluster under18/dockernext to the old files. Nothing is deleted, but the database starts empty. Anyone upgrading should take the backup the README already describes before pulling this.Docs
The changelog entry is in fullstackhero/docs#252.