diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml index 17eef14de0..0d5e575432 100644 --- a/deploy/docker/docker-compose.yml +++ b/deploy/docker/docker-compose.yml @@ -19,7 +19,9 @@ services: POSTGRES_USER: fsh POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required} volumes: - - pg_data:/var/lib/postgresql/data + # The 18+ images keep PGDATA in a versioned subdirectory (/var/lib/postgresql/18/docker) and + # refuse to start with a mount at the old /var/lib/postgresql/data, even on an empty volume. + - pg_data:/var/lib/postgresql - ./postgres-init:/docker-entrypoint-initdb.d:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U fsh -d fsh"] diff --git a/deploy/docker/postgres-init/01-create-databases.sql b/deploy/docker/postgres-init/01-create-databases.sql index 429622701e..5aadc12a50 100644 --- a/deploy/docker/postgres-init/01-create-databases.sql +++ b/deploy/docker/postgres-init/01-create-databases.sql @@ -1,5 +1,5 @@ -- Postgres init for fullstackhero --- This file runs only on first boot (when /var/lib/postgresql/data is empty). +-- This file runs only on first boot (when the data directory under /var/lib/postgresql is empty). -- The `fsh` database itself is created by POSTGRES_DB= in the compose env; -- we just add the extensions the framework relies on.