Spaces:
Sleeping
Sleeping
tyriaa
commited on
Commit
·
bfe89fe
1
Parent(s):
c9c6b8d
4rd commit
Browse files- Dockerfile +4 -3
- api.py +4 -0
- 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=
|
18 |
ENV FLASK_ENV=production
|
|
|
19 |
|
20 |
# Exposer le port sur lequel l'application s'exécute
|
21 |
-
EXPOSE
|
22 |
|
23 |
# Commande pour démarrer l'application avec Gunicorn
|
24 |
-
CMD ["gunicorn", "--
|
|
|
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"
|