Files
ds_zagres_ai/ai_service/deploy.sh
T

21 lines
636 B
Bash
Raw Normal View History

2025-05-09 15:41:16 +01:00
#!/bin/bash
# Create a directory for the AI service logs
mkdir -p logs
# Activate virtual environment
source venv/bin/activate
# Export environment variables
export API_HOST=0.0.0.0
export API_PORT=5251
# Make sure the Python path includes the current directory
export PYTHONPATH=$PYTHONPATH:$(pwd)
# Run the application with uvicorn and nohup
2025-05-09 16:47:30 +01:00
nohup uvicorn ai_service.api:app --host $API_HOST --port $API_PORT > logs/ai_service.log 2>&1 &
2025-05-09 15:41:16 +01:00
echo "AI Service started on port $API_PORT. Check ai_service.log for output."
echo "To stop the application, find the process ID with 'ps aux | grep uvicorn' and kill it with 'kill <PID>'."