diff --git a/docker-compose.yml b/docker-compose.yml index 4e729ab..2420d81 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,12 +16,17 @@ services: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in the stack} POSTGRES_DB: vmselector volumes: - - db_data:/var/lib/postgresql/data + # Postgres 18 moved PGDATA to /var/lib/postgresql/18/docker and its declared + # VOLUME to /var/lib/postgresql. Mounting the pre-18 /var/lib/postgresql/data + # leaves the real data outside the volume, and trips the entrypoint. + - db_data:/var/lib/postgresql healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres -d vmselector'] interval: 5s timeout: 5s retries: 10 + # initdb runs on the very first boot: do not count failures before it is done + start_period: 30s networks: [internal] # Runs once per deployment, before the app: applies any new migration, then exits