fix(compose): mount postgres volume at /var/lib/postgresql for PG18+ layout #139

Merged
fastie81 merged 1 commit from fix/pg18-mount-path into main 2026-09-06 19:59:17 +12:00
Owner

Problem (caught in deploy-to-test, not prod)

The PG18 upgrade deploy to the test node crash-looped the postgres:18-alpine container. Root cause: the official postgres 18 image changed its data-layout — 18+ stores data in a major-version subfolder and requires the volume mounted at the PARENT path /var/lib/postgresql, refusing to init when only /var/lib/postgresql/data is mounted (≤17 layout).

Fix

Change the postgres data mount from /var/lib/postgresql/data to /var/lib/postgresql. This is what 18+ requires and remains compatible with 15, so routine deploys ar unchanged.

- postgres_data${POSTGRES_MAJOR:+_${POSTGRES_MAJOR}}:/var/lib/postgresql/data
+ postgres_data${POSTGRES_MAJOR:+_${POSTGRES_MAJOR}}:/var/lib/postgresql

Volume-name logic unchanged: postgres_data on routine deploys, postgres_data_<major> when POSTGRES_MAJOR is set (PG18 upgrade path).

Why this is safe

  • Isolated to the postgres container mount path; app entrypoint, migrations, RLS bootstrap, and auto-restore are untouched.
  • Parent mount is validated to b e compatible with both PG15 (current prod/test) and PG18.
  • Merge triggers a deploy to the TEST node only (prod is untouched until a v-tag).
## Problem (caught in deploy-to-test, not prod) The PG18 upgrade deploy to the test node crash-looped the `postgres:18-alpine` container. Root cause: the official postgres 18 image changed its data-layout — 18+ stores data in a major-version subfolder and **requires the volume mounted at the PARENT path `/var/lib/postgresql`**, refusing to init when only `/var/lib/postgresql/data` is mounted (≤17 layout). ## Fix Change the postgres data mount from `/var/lib/postgresql/data` to `/var/lib/postgresql`. This is what 18+ requires and remains compatible with 15, so routine deploys ar unchanged. ``` - postgres_data${POSTGRES_MAJOR:+_${POSTGRES_MAJOR}}:/var/lib/postgresql/data + postgres_data${POSTGRES_MAJOR:+_${POSTGRES_MAJOR}}:/var/lib/postgresql ``` Volume-name logic unchanged: `postgres_data` on routine deploys, `postgres_data_<major>` when `POSTGRES_MAJOR` is set (PG18 upgrade path). ## Why this is safe - Isolated to the postgres container mount path; app entrypoint, migrations, RLS bootstrap, and auto-restore are untouched. - Parent mount is validated to b e compatible with both PG15 (current prod/test) and PG18. - Merge triggers a deploy to the TEST node only (prod is untouched until a v-tag).
fix(compose): mount postgres volume at /var/lib/postgresql (PG18+ layout)
All checks were successful
CI / test (push) Successful in 2m11s
CI / lint-frontend (push) Successful in 59s
CI / build (push) Has been skipped
CI / deploy (push) Has been skipped
46d0606b33
Deploy-to-test exposed that the official postgres:18 image changed its data
dir to a major-version subfolder and REQUIRES the volume mounted at the
parent /var/lib/postgresql; it refuses to init when only
/var/lib/postgresql/data is mounted (crash-loop).  Mounting at the parent is
also compatible with PG15, so this fixes the PG18 upgrade path while keeping
routine deploys identical.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fastie81/honbu-manager!139
No description provided.