tyriaa commited on
Commit
bfe89fe
·
1 Parent(s): c9c6b8d

4rd commit

Browse files
Files changed (3) hide show
  1. Dockerfile +4 -3
  2. api.py +4 -0
  3. gunicorn_config.py +4 -0
Dockerfile CHANGED
@@ -14,11 +14,12 @@ RUN pip install --no-cache-dir -r requirements.txt
14
  COPY . .
15
 
16
  # Variables d'environnement
17
- ENV FLASK_APP=app.py
18
  ENV FLASK_ENV=production
 
19
 
20
  # Exposer le port sur lequel l'application s'exécute
21
- EXPOSE 5003
22
 
23
  # Commande pour démarrer l'application avec Gunicorn
24
- CMD ["gunicorn", "--bind", "0.0.0.0:5003", "app:app"]
 
14
  COPY . .
15
 
16
  # Variables d'environnement
17
+ ENV FLASK_APP=api.py
18
  ENV FLASK_ENV=production
19
+ ENV PORT=7860
20
 
21
  # Exposer le port sur lequel l'application s'exécute
22
+ EXPOSE 7860
23
 
24
  # Commande pour démarrer l'application avec Gunicorn
25
+ CMD ["gunicorn", "--config", "gunicorn_config.py", "api:app"]
api.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from app import app
2
+
3
+ if __name__ == "__main__":
4
+ app.run(host="0.0.0.0", port=7860)
gunicorn_config.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ bind = "0.0.0.0:7860"
2
+ workers = 1
3
+ timeout = 120
4
+ worker_class = "sync"