From 32ef5e1978fc01b88c1a6c149a9c13dbeda77775 Mon Sep 17 00:00:00 2001 From: Eric0801 <33929918+Eric0801@users.noreply.github.com> Date: Wed, 22 Oct 2025 16:50:08 +0800 Subject: [PATCH] fix: use Railway PORT env var for dynamic port binding --- start.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index b281b0e..64bce2b 100755 --- a/start.sh +++ b/start.sh @@ -3,5 +3,8 @@ cd /flask echo "Working directory: $(pwd)" echo "Checking assets files:" ls -la assets*.json 2>&1 || echo "No assets files found" -echo "Starting gunicorn..." -exec gunicorn -w 2 -b 0.0.0.0:8000 --timeout 120 main:app + +# Use Railway's PORT env var if available, otherwise default to 8000 +PORT=${PORT:-8000} +echo "Starting gunicorn on port $PORT..." +exec gunicorn -w 2 -b 0.0.0.0:$PORT --timeout 120 main:app