Add Gunicorn support for production in Vosk service and update requirements

This commit is contained in:
Alireza
2025-08-02 17:52:11 +03:30
parent 0d151529f0
commit cfe2b2346a
7 changed files with 220 additions and 6 deletions

View File

@@ -44,10 +44,20 @@ if ! curl -s http://localhost:5000/ > /dev/null; then
# Start optimized Vosk service
cd ../vosk_service
export USE_ASYNC=true
python app_optimized.py &
VOSK_PID=$!
echo "✅ Vosk service started with PID: $VOSK_PID"
# Choose between async and production mode
if [ "$USE_ASYNC" = "true" ]; then
export USE_ASYNC=true
python start_service.py &
VOSK_PID=$!
echo "✅ Vosk async service started with PID: $VOSK_PID"
else
# Use Gunicorn for production multiprocessing
export USE_GUNICORN=true
gunicorn -c gunicorn_config.py app_optimized:app &
VOSK_PID=$!
echo "✅ Vosk Gunicorn service started with PID: $VOSK_PID"
fi
# Wait for service to be ready
echo "⏳ Waiting for service to be ready..."