Problem
apps/postgres-18.yml mounts the data volume at /var/lib/postgresql/data:
volumes:
- ../apps-data/${APP_NAME}/postgres:/var/lib/postgresql/data
PostgreSQL 18+ images changed the default data directory structure — they now expect the mount at /var/lib/postgresql and create a versioned subdirectory (18/main) inside it. Mounting at /var/lib/postgresql/data causes postgres to fail on startup with:
Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names).
...
Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)
See: docker-library/postgres#1259
Fix
volumes:
- ../apps-data/${APP_NAME}/postgres:/var/lib/postgresql
🤖 Generated with Claude Code
Problem
apps/postgres-18.ymlmounts the data volume at/var/lib/postgresql/data:PostgreSQL 18+ images changed the default data directory structure — they now expect the mount at
/var/lib/postgresqland create a versioned subdirectory (18/main) inside it. Mounting at/var/lib/postgresql/datacauses postgres to fail on startup with:See: docker-library/postgres#1259
Fix
🤖 Generated with Claude Code