From 3807d9554c839edb4b00651f399fcfeddf38e14d Mon Sep 17 00:00:00 2001 From: David Kiania Date: Fri, 24 Apr 2026 10:59:53 +0300 Subject: [PATCH] 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 --- docker-compose.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index b14559c..34b5b80 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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