From 8ddf5bf40d1463b23d3f704ec46d7cef80592703 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 25 Apr 2026 20:40:34 +0000 Subject: [PATCH] fix: start.sh with import pre-check + single worker for Railway MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds import verification before uvicorn starts — if imports fail, container exits immediately with clear error instead of timing out on healthcheck. Single worker to reduce memory usage on Railway. https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs --- salesflow-saas/backend/start.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/salesflow-saas/backend/start.sh b/salesflow-saas/backend/start.sh index da2b4fad..b3d2dd03 100755 --- a/salesflow-saas/backend/start.sh +++ b/salesflow-saas/backend/start.sh @@ -1,4 +1,7 @@ #!/bin/sh -# start.sh — Railway-compatible start script -# Uses $PORT from Railway (default 8000 if not set) -exec uvicorn app.main:app --host 0.0.0.0 --port "${PORT:-8000}" --workers 2 +echo "[dealix] Starting on port ${PORT:-8000}..." +echo "[dealix] Python: $(python3 --version)" +echo "[dealix] Testing imports..." +python3 -c "from app.main import app; print(f'[dealix] Routes: {len(app.routes)}'); print('[dealix] Import OK')" 2>&1 || { echo "[dealix] IMPORT FAILED"; exit 1; } +echo "[dealix] Launching uvicorn..." +exec uvicorn app.main:app --host 0.0.0.0 --port "${PORT:-8000}" --workers 1 --timeout-keep-alive 30