From ebabb9f04466e83d193825ca34845ee5503c2bce Mon Sep 17 00:00:00 2001 From: Simon Strandgaard Date: Sat, 21 Mar 2026 15:51:55 +0100 Subject: [PATCH] fix: respect Railway PORT env var in database_worker Railway injects a PORT variable and routes healthcheck traffic to it. The server now checks PORT first, falling back to PLANEXE_DATABASE_WORKER_PORT for Docker Compose. Co-Authored-By: Claude Opus 4.6 (1M context) --- database_worker/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database_worker/server.py b/database_worker/server.py index 96b22265..00505ab7 100644 --- a/database_worker/server.py +++ b/database_worker/server.py @@ -15,7 +15,8 @@ PGUSER = os.environ.get("PGUSER", "planexe") PGPASSWORD = os.environ.get("PGPASSWORD", "planexe") API_KEY = os.environ.get("PLANEXE_DATABASE_WORKER_API_KEY", "") -PORT = int(os.environ.get("PLANEXE_DATABASE_WORKER_PORT", "8002")) +# Railway injects PORT; fall back to PLANEXE_DATABASE_WORKER_PORT for Docker Compose. +PORT = int(os.environ.get("PORT") or os.environ.get("PLANEXE_DATABASE_WORKER_PORT", "8002")) # zstd typically compresses better and faster than gzip, so it's preferred. # pg_dump >= 16 supports -Z zstd natively; also requires the zstd binary.