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