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) <noreply@anthropic.com>
21 lines
592 B
Bash
Executable File
21 lines
592 B
Bash
Executable File
#!/bin/sh
|
|
# Start FastAPI backend + Next.js frontend in the same container.
|
|
# Both processes log to stdout/stderr so Docker captures everything.
|
|
|
|
set -e
|
|
|
|
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=$!
|
|
|
|
# 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
|