-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·37 lines (31 loc) · 869 Bytes
/
Copy pathstart.sh
File metadata and controls
executable file
·37 lines (31 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
echo "=== FinSight AI Starting ==="
echo "CHROMA_PERSIST_DIR: ${CHROMA_PERSIST_DIR:-./data/chroma}"
echo "Starting FastAPI on port 8000..."
uvicorn src.api.main:app \
--host 0.0.0.0 \
--port 8000 \
--workers 1 \
--log-level info &
API_PID=$!
echo "Waiting for API to be ready..."
MAX_WAIT=120
WAITED=0
until curl -sf http://localhost:8000/health > /dev/null 2>&1; do
if [ $WAITED -ge $MAX_WAIT ]; then
echo "ERROR: API did not start within ${MAX_WAIT}s"
exit 1
fi
sleep 2
WAITED=$((WAITED + 2))
echo " Waited ${WAITED}s..."
done
echo "API is ready after ${WAITED}s"
echo "Starting Streamlit on port 7860..."
exec streamlit run src/ui/app.py \
--server.port=7860 \
--server.address=0.0.0.0 \
--server.headless=true \
--server.enableCORS=false \
--server.enableXsrfProtection=false