QuentinL52's picture
Create start.sh
f2911e7 verified
raw
history blame
832 Bytes
#!/bin/bash
# Lancer le serveur Redis en arrière-plan
echo "Lancement de Redis..."
redis-server --daemonize yes
sleep 2 # Laisse un peu de temps à Redis pour démarrer
# Lancer le worker Celery en arrière-plan
# La commande est corrigée pour pointer vers la bonne instance d'application Celery
echo "Lancement du worker Celery..."
celery -A tasks.worker_celery:celery_app worker --loglevel=info &
# Lancer l'API FastAPI (le backend modèle) en arrière-plan
echo "Lancement de l'API FastAPI..."
uvicorn main:app --host 0.0.0.0 --port 8000 &
# Lancer l'application Flask (le frontend) au premier plan
# Gunicorn est un serveur de production robuste. C'est lui qui répondra à Hugging Face.
echo "Lancement de l'application Flask sur le port 7860..."
gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 8 --timeout 120 app:app