Mount pgdata at the directory Postgres 18 actually uses

This commit is contained in:
Esa Kataja
2026-07-31 19:45:00 +03:00
parent ab8c90d445
commit 0a8c36fd82
2 changed files with 5 additions and 5 deletions
+3 -4
View File
@@ -5,11 +5,10 @@ services:
POSTGRES_USER: levyraati
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
POSTGRES_DB: levyraati
# The 18 image moved its default data directory; pin it so the ./pgdata mount below
# is still where the database lives.
PGDATA: /var/lib/postgresql/data
volumes:
- ./pgdata:/var/lib/postgresql/data
# Postgres 18 keeps its data in /var/lib/postgresql/<version>/docker, so the mount is the
# parent directory, not the old /var/lib/postgresql/data.
- ./pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U levyraati"]
interval: 5s