File size: 653 Bytes
f871fed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
set -e

echo "Starting SurrealDB in background..."
surreal start --log debug --user root --pass root memory &
SURREAL_PID=$!

echo "Waiting 5 seconds for SurrealDB to initialize..."
sleep 5

# Check if SurrealDB process is still running
if ! kill -0 $SURREAL_PID 2>/dev/null; then
    echo "ERROR: SurrealDB failed to start"
    exit 1
fi

echo "SurrealDB started successfully (PID: $SURREAL_PID)"
echo "Starting FastAPI application on port 7860..."

# Set environment variables for Hugging Face deployment
export API_HOST=0.0.0.0
export API_PORT=7860
export API_RELOAD=false

# Start the FastAPI app using run_api.py
exec python run_api.py