From bf595975bf31ab91503ab22bcb8d4b720e4dc149 Mon Sep 17 00:00:00 2001 From: Chaim Date: Mon, 13 Apr 2026 14:55:04 +0000 Subject: [PATCH] Fix start.sh: redirect uvicorn output to Docker logs uvicorn was running in background with no output capture, making it impossible to debug crashes. Now redirects stderr to stdout and checks if uvicorn started successfully. Co-Authored-By: Claude Opus 4.6 (1M context) --- start.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/start.sh b/start.sh index 846df60..3bec63f 100755 --- a/start.sh +++ b/start.sh @@ -1,13 +1,20 @@ #!/bin/sh # Start FastAPI backend + Next.js frontend in the same container. -# Uvicorn runs in the background; Node.js runs in the foreground -# so that Docker gets its exit signal from the primary process. +# Both processes log to stdout/stderr so Docker captures everything. set -e -echo "Starting FastAPI backend on :8000 ..." -uvicorn web.app:app --host 127.0.0.1 --port 8000 --workers 1 & +echo "[start.sh] Starting FastAPI backend on :8000 ..." +uvicorn web.app:app --host 127.0.0.1 --port 8000 --workers 1 2>&1 & UVICORN_PID=$! -echo "Starting Next.js frontend on :3000 ..." -exec node server.js +# Give uvicorn a moment to start (or crash) +sleep 2 + +if ! kill -0 $UVICORN_PID 2>/dev/null; then + echo "[start.sh] ERROR: uvicorn failed to start!" + # Don't exit — let Node.js run so the UI is accessible for debugging +fi + +echo "[start.sh] Starting Next.js frontend on :3000 ..." +node server.js