|
#!/bin/bash |
|
set -e |
|
|
|
|
|
cleanup() { |
|
echo "Shutting down services..." |
|
kill $(jobs -p) 2>/dev/null |
|
exit |
|
} |
|
|
|
|
|
trap cleanup EXIT |
|
|
|
|
|
echo "=== Environment Information ===" |
|
echo "Python version: $(python --version)" |
|
echo "Current directory: $(pwd)" |
|
echo "Files in directory: $(ls -l)" |
|
echo "===============================" |
|
|
|
|
|
export UVICORN_WS_PROTOCOL=websockets |
|
|
|
unset CHAINLIT_SOCKETIO_PATH |
|
unset CHAINLIT_SOCKETIO_ENABLED |
|
export CHAINLIT_LOG_LEVEL=debug |
|
|
|
|
|
export HTTP_PROXY="" |
|
export HTTPS_PROXY="" |
|
export NO_PROXY="localhost,127.0.0.1" |
|
|
|
|
|
echo "Starting backend on http://0.0.0.0:8000..." |
|
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --log-level debug & |
|
backend_pid=$! |
|
|
|
|
|
echo "Waiting for backend to start..." |
|
sleep 5 |
|
|
|
|
|
if ! kill -0 $backend_pid 2>/dev/null; then |
|
echo "ERROR: Backend failed to start!" |
|
exit 1 |
|
fi |
|
echo "Backend started successfully with PID $backend_pid" |
|
|
|
|
|
echo "Starting frontend on http://0.0.0.0:7860..." |
|
chainlit run app.py --host 0.0.0.0 --port 7860 --no-cache & |
|
frontend_pid=$! |
|
|
|
|
|
echo "Waiting for frontend to start..." |
|
sleep 5 |
|
|
|
|
|
if ! kill -0 $frontend_pid 2>/dev/null; then |
|
echo "ERROR: Frontend failed to start!" |
|
exit 1 |
|
fi |
|
echo "Frontend started successfully with PID $frontend_pid" |
|
|
|
echo "All services started successfully!" |
|
|
|
|
|
wait |