fix(db): mount TimescaleDB HA volume at correct PGDATA path

The timescale/timescaledb-ha image uses /home/postgres/pgdata/data as
PGDATA, not /var/lib/postgresql/data. The previous mount pointed at an
empty directory that postgres never wrote to, so Coolify redeploys
destroyed all data with the container's overlay filesystem.

Pin PGDATA explicitly and move the named timescale-data volume to
/home/postgres/pgdata so the real data dir is persisted.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
David Kiania 2026-04-24 10:59:53 +03:00
parent fa110f4313
commit 3807d9554c

View file

@ -6,10 +6,13 @@ services:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
# HA image's PGDATA is /home/postgres/pgdata/data, not /var/lib/postgresql/data.
# Mount the named volume there so data survives container rebuilds.
- PGDATA=/home/postgres/pgdata/data
ports:
- "5433:5432"
volumes:
- timescale-data:/var/lib/postgresql/data
- timescale-data:/home/postgres/pgdata
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s