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