From b9b91397b004c5f52352c679aba778e4e41e0973 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Thu, 18 Jun 2026 01:38:33 +0330 Subject: [PATCH] fix(deploy): configurable postgres host port (avoid 5432 conflict) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fr2-postgres failed to start after another local project's postgres grabbed host port 5432 during downtime. The internal stack always connects via postgres:5432 on the docker network, so the published host port is only for external tooling — make it ${PG_HOST_PORT:-5532} to avoid the clash. (Also recovered from a stale bind-mount where scripts/init-db.sh had become a directory; current compose mounts deploy/postgres-initdb/.) Co-Authored-By: Claude Opus 4.8 --- docker-compose.v2.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.v2.yml b/docker-compose.v2.yml index 70c3d1e..5ac1938 100644 --- a/docker-compose.v2.yml +++ b/docker-compose.v2.yml @@ -32,7 +32,9 @@ services: ports: # HOST_BIND=127.0.0.1 in prod keeps these off the public interface (only # Caddy's 80/443 face the internet). Unset → 0.0.0.0 for local/LAN dev. - - "${HOST_BIND:-0.0.0.0}:5432:5432" + # Host port is configurable (PG_HOST_PORT) — 5432 is often taken by another + # local project's postgres; the internal stack always uses postgres:5432. + - "${HOST_BIND:-0.0.0.0}:${PG_HOST_PORT:-5532}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d flatrender"] interval: 5s