enzo-09 commited on
Commit
c167dd2
·
1 Parent(s): 1d08b36

Initial commit with Flask API and Docker setup

Browse files
Files changed (3) hide show
  1. Dockerfile +3 -14
  2. app.py +1 -1
  3. requirements.txt +2 -1
Dockerfile CHANGED
@@ -1,18 +1,7 @@
1
- # Utiliser une image Python officielle comme base
2
- FROM python:3.9-slim
3
-
4
- # Définir le répertoire de travail
5
  WORKDIR /app
6
-
7
- # Copier les fichiers requirements.txt (à créer) et installer les dépendances
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
-
11
- # Copier tout le code de l'application dans le conteneur
12
  COPY . .
13
-
14
- # Exposer le port sur lequel l'application va tourner (5000 dans votre cas)
15
- EXPOSE 5000
16
-
17
- # Commande pour lancer l'application
18
- CMD ["python", "app.py"]
 
1
+ FROM python:3.9
 
 
 
2
  WORKDIR /app
 
 
3
  COPY requirements.txt .
4
  RUN pip install --no-cache-dir -r requirements.txt
 
 
5
  COPY . .
6
+ EXPOSE 7860
7
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
 
 
 
app.py CHANGED
@@ -165,4 +165,4 @@ def assign_patient():
165
  return jsonify(response)
166
 
167
  if __name__ == "__main__":
168
- app.run(debug=True, port=5000)
 
165
  return jsonify(response)
166
 
167
  if __name__ == "__main__":
168
+ app.run(debug=True, host="0.0.0.0", port=7860)
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
  Flask==2.3.2
2
  flask-cors==4.0.0
3
  numpy==1.26.0
4
- Werkzeug==2.3.7
 
 
1
  Flask==2.3.2
2
  flask-cors==4.0.0
3
  numpy==1.26.0
4
+ Werkzeug==2.3.7
5
+ gunicorn==22.0.0