Spaces:
Build error
Build error
Delete entrypoint.sh
Browse files- entrypoint.sh +0 -32
entrypoint.sh
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
# entrypoint.sh
|
| 3 |
-
|
| 4 |
-
# Afficher les commandes exécutées
|
| 5 |
-
set -e
|
| 6 |
-
|
| 7 |
-
echo "--- Démarrage de l'Application Gunicorn et du Data Committer ---"
|
| 8 |
-
|
| 9 |
-
# Définir le port par défaut de Hugging Face si $PORT est vide
|
| 10 |
-
# Utiliser 7860 qui est le port par défaut de Hugging Face Spaces
|
| 11 |
-
export APP_PORT=${PORT:-7860}
|
| 12 |
-
|
| 13 |
-
# 1. Démarrer le serveur Flask/Gunicorn en arrière-plan
|
| 14 |
-
# Le paramètre $APP_PORT est maintenant garanti d'avoir une valeur
|
| 15 |
-
echo "Démarrage du serveur Gunicorn sur le port $APP_PORT..."
|
| 16 |
-
gunicorn --workers $GUNICORN_WORKERS --threads $GUNICORN_THREADS app:app -b 0.0.0.0:$APP_PORT &
|
| 17 |
-
|
| 18 |
-
# Capturer le PID du processus Gunicorn
|
| 19 |
-
GUNICORN_PID=$!
|
| 20 |
-
echo "Gunicorn démarré avec PID: $GUNICORN_PID"
|
| 21 |
-
|
| 22 |
-
# 2. Démarrer le committer en arrière-plan
|
| 23 |
-
echo "Démarrage du Data Committer..."
|
| 24 |
-
python data_committer.py &
|
| 25 |
-
|
| 26 |
-
# Capturer le PID du processus Committer
|
| 27 |
-
COMMITTER_PID=$!
|
| 28 |
-
echo "Data Committer démarré avec PID: $COMMITTER_PID"
|
| 29 |
-
|
| 30 |
-
# 3. Attendre que l'un des processus en arrière-plan se termine
|
| 31 |
-
# Si l'un des processus meurt, le container doit s'arrêter pour éviter un état zombie.
|
| 32 |
-
wait -n $GUNICORN_PID $COMMITTER_PID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|