QuentinL52 commited on
Commit
e553362
·
verified ·
1 Parent(s): bb44c89

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +12 -11
start.sh CHANGED
@@ -1,24 +1,25 @@
1
  #!/bin/bash
2
 
3
- # Start Redis in the background
4
  echo "Lancement de Redis..."
5
  redis-server --daemonize yes
6
  sleep 2
7
 
8
- # Start the Celery worker in the background
9
  echo "Lancement du worker Celery..."
10
- # We use python -m here as it's reliable for background tasks
11
  python -m celery -A tasks.worker_celery:celery_app worker --loglevel=info &
12
 
13
- # Start the FastAPI API in the background
14
  echo "Lancement de l'API FastAPI..."
15
  python -m uvicorn main:app --host 0.0.0.0 --port 8000 &
16
 
17
- # --- THE DEFINITIVE FIX ---
18
- # 1. Change to the application directory. This is the crucial step.
19
- cd /app || exit
 
 
 
 
20
 
21
- # 2. Execute Gunicorn. 'exec' replaces the shell process with the gunicorn process.
22
- # This is the main process of the container.
23
- echo "Lancement de l'application Flask depuis le dossier /app..."
24
- exec python -m gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 8 --timeout 120 app:app
 
1
  #!/bin/bash
2
 
3
+ # Lancer les services en arrière-plan
4
  echo "Lancement de Redis..."
5
  redis-server --daemonize yes
6
  sleep 2
7
 
 
8
  echo "Lancement du worker Celery..."
 
9
  python -m celery -A tasks.worker_celery:celery_app worker --loglevel=info &
10
 
 
11
  echo "Lancement de l'API FastAPI..."
12
  python -m uvicorn main:app --host 0.0.0.0 --port 8000 &
13
 
14
+ # --- ÉTAPE DE DÉBOGAGE ET LANCEMENT FINAL ---
15
+ echo "--- Début du débogage ---"
16
+ echo "Répertoire de travail actuel : $(pwd)"
17
+ echo "Contenu du répertoire /app :"
18
+ ls -la /app
19
+ echo "Variable PYTHONPATH : $PYTHONPATH"
20
+ echo "--- Fin du débogage ---"
21
 
22
+ # On lance Gunicorn en forçant le PYTHONPATH directement dans la commande.
23
+ # C'est la méthode la plus explicite possible.
24
+ echo "Lancement de Gunicorn avec un chemin Python explicite..."
25
+ exec env PYTHONPATH=/app python -m gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 8 --timeout 120 app:app