Skip to content

Default dev docker-compose Postgres to 18, add PG_VERSION escape hatch (#1885)#190

Open
labkey-willm wants to merge 1 commit into
developfrom
fb_pg18_dev_compose
Open

Default dev docker-compose Postgres to 18, add PG_VERSION escape hatch (#1885)#190
labkey-willm wants to merge 1 commit into
developfrom
fb_pg18_dev_compose

Conversation

@labkey-willm

Copy link
Copy Markdown
Contributor

Rationale

Part of the PostgreSQL 18 migration (LabKey/kanban#1885), covering the "Dev environment (docker-compose.yml)" task. Flips the dev database default from Postgres 15 to Postgres 18 while giving existing developers a safe path off their old data.

Changes

Flip all four pg-* services from postgres:15 to postgres:${PG_VERSION:-18}; PG_VERSION=15 is a one-line override to keep running existing 15.x data.

Pin PGDATA=/var/lib/postgresql/data on each pg service. The postgres:18 image moved its default PGDATA to /var/lib/postgresql/18/docker, which would otherwise bypass the existing bind mount and silently stop persisting data. Pinning restores the prior mount behavior (no-op on 15).

Version-namespace the host data dir (./pgdata/postgres-<PG_VERSION>-data) so switching versions gets a clean directory instead of a crash, and un-silence the pg entrypoint so startup/version errors surface in docker compose logs instead of a silent crash-loop.

README documents the new default, the PG_VERSION override, and a pg15 -> pg18 dump/restore path.

Testing

Validated end-to-end locally: LabKey 26.6 community bootstrapped all module schemas into PostgreSQL 18.4 (PostgreSql_18_Dialect) and served HTTP 200; data persisted to the host bind mount as expected.

🤖 Generated with Claude Code

…h (#1885)

Flips the four pg-* services from postgres:15 to postgres:${PG_VERSION:-18} so the dev database defaults to Postgres 18, with PG_VERSION as a one-line override for anyone who needs to stay on their existing 15.x data.

Pins PGDATA=/var/lib/postgresql/data on each pg service because the postgres:18 image moved its default PGDATA to /var/lib/postgresql/18/docker, which would otherwise bypass the existing bind mount and silently stop persisting data. Version-namespaces the host data dir (./pgdata/postgres-<PG_VERSION>-data) so switching versions never corrupts an existing directory, and un-silences the pg entrypoint so startup/version errors surface in docker compose logs instead of a silent crash-loop.

Validated end-to-end: LabKey 26.6 community bootstraps all module schemas into PostgreSQL 18.4 and serves HTTP 200. README documents the new default, the PG_VERSION override, and a pg15->pg18 dump/restore path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant