From 0a8c36fd829bcd11373614f73115ab6e83734c7b Mon Sep 17 00:00:00 2001 From: Esa Kataja Date: Fri, 31 Jul 2026 19:45:00 +0300 Subject: [PATCH] Mount pgdata at the directory Postgres 18 actually uses --- README.md | 3 ++- docker-compose.yml | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fe539fe..8cac040 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,8 @@ JSON to stdout, nothing else. There is no log table and no log viewer in the app Two paths hold everything: -- `./pgdata` — the database +- `./pgdata` — the database. Postgres 18 stores it under a version subdirectory (`18/docker`), so + the mount is `/var/lib/postgresql`, not `/var/lib/postgresql/data` - `./storage` — audio files and avatars Both are bind mounts. `storage/tmp/` is in-flight conversions and is safe to skip; it's cleared on diff --git a/docker-compose.yml b/docker-compose.yml index c1051a7..95162c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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//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