Create start.sh
Browse files
start.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Lancer le serveur Redis en arrière-plan
|
| 4 |
+
echo "Lancement de Redis..."
|
| 5 |
+
redis-server --daemonize yes
|
| 6 |
+
sleep 2 # Laisse un peu de temps à Redis pour démarrer
|
| 7 |
+
|
| 8 |
+
# Lancer le worker Celery en arrière-plan
|
| 9 |
+
# La commande est corrigée pour pointer vers la bonne instance d'application Celery
|
| 10 |
+
echo "Lancement du worker Celery..."
|
| 11 |
+
celery -A tasks.worker_celery:celery_app worker --loglevel=info &
|
| 12 |
+
|
| 13 |
+
# Lancer l'API FastAPI (le backend modèle) en arrière-plan
|
| 14 |
+
echo "Lancement de l'API FastAPI..."
|
| 15 |
+
uvicorn main:app --host 0.0.0.0 --port 8000 &
|
| 16 |
+
|
| 17 |
+
# Lancer l'application Flask (le frontend) au premier plan
|
| 18 |
+
# Gunicorn est un serveur de production robuste. C'est lui qui répondra à Hugging Face.
|
| 19 |
+
echo "Lancement de l'application Flask sur le port 7860..."
|
| 20 |
+
gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 8 --timeout 120 app:app
|