#!/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