chore(compose): update postgres to 18 and redis to 8 - #2
Merged
Conversation
Postgres 18 images store data under a major-version subdirectory (PGDATA=/var/lib/postgresql/18/docker) instead of /var/lib/postgresql/data, so the named volume is now mounted at the parent /var/lib/postgresql. Changing only the tag would leave the data directory outside the volume. Redis 7 resolves to 7.4.x, which is dual RSALv2/SSPLv1. Redis 8 is tri-licensed under RSALv2, SSPLv1 or AGPLv3, so this also restores an OSI-approved option. Redis is used purely as a cache here, so the volume carries no state worth migrating. Existing postgres volumes were initialised by 16 and are not readable by 18; they have to be recreated. No published deployments exist yet. Verified: full dev stack rebuilt from empty volumes, all four services healthy, PostgreSQL 18.6 with PGDATA under /var/lib/postgresql/18/docker, Redis 8.10.1, 21 migrations applied and surviving a db restart, health endpoint and login both 200.
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.
What does this change?
Bumps both datastores in
compose.ymlandcompose.dev.ymlto the current releases:postgres:16-alpine→postgres:18-alpine,redis:7-alpine→redis:8-alpine.The Postgres bump is not just a tag change. Postgres 18 images moved the data directory to a major-version subdirectory:
postgres:16-alpine/var/lib/postgresql/datapostgres:18-alpine/var/lib/postgresql/18/dockerThe named volume is therefore mounted at the parent
/var/lib/postgresql. Bumping only the tag would leave the data directory outside the volume, silently losing persistence. See docker-library/postgres#1259.Redis licensing improves here.
redis:7-alpineresolves to 7.4.x, which is dual RSALv2/SSPLv1 — only 7.2.4 and earlier were BSD 3-clause. Redis 8 is tri-licensed under RSALv2, SSPLv1 or AGPLv3, restoring an OSI-approved option. Flagward is MIT and consumes Redis as a separate network service, so the server's licence does not affect it.Breaking change
Postgres volumes initialised by 16 cannot be read by 18 — the container refuses to start and asks for
pg_upgrade. Existing volumes must be recreated:In development this costs nothing:
migrateandcreate_super_userrun on startup. No deployments exist yet, so no upgrade path is documented.How was it verified?
Full dev stack rebuilt from empty volumes:
healthyselect version()→ PostgreSQL 18.6,PGDATA=/var/lib/postgresql/18/docker,PG_VERSION= 18redis-cli INFO server→redis_version:8.10.1docker compose restart db— confirms the volume mount is correctGET /api/v1/health/→ 200,POST /api/v1/auth/login/→ 200, frontend → 307 (redirect to login)ruff check .clean,pytest141 passedChecklist
ruff check .passespytestpassesnpm run lintandnpm run buildpass, if the frontend changed — n/a, frontend untouched