Default dev docker-compose Postgres to 18, add PG_VERSION escape hatch (#1885)#190
Open
labkey-willm wants to merge 1 commit into
Open
Default dev docker-compose Postgres to 18, add PG_VERSION escape hatch (#1885)#190labkey-willm wants to merge 1 commit into
labkey-willm wants to merge 1 commit into
Conversation
…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>
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.
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:15topostgres:${PG_VERSION:-18};PG_VERSION=15is a one-line override to keep running existing 15.x data.Pin
PGDATA=/var/lib/postgresql/dataon each pg service. Thepostgres:18image 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 indocker compose logsinstead of a silent crash-loop.README documents the new default, the
PG_VERSIONoverride, 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