Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -2
Dockerfile
CHANGED
|
@@ -2,12 +2,17 @@ FROM python:3.9-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
| 6 |
|
|
|
|
| 7 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
|
|
|
| 11 |
EXPOSE 8001
|
| 12 |
|
|
|
|
| 13 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Copie requirements.txt d'abord pour optimiser le cache Docker
|
| 6 |
+
COPY ./requirements.txt .
|
| 7 |
|
| 8 |
+
# Installe les dépendances
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copie le reste des fichiers du projet
|
| 12 |
+
COPY . .
|
| 13 |
|
| 14 |
+
# Expose le port sur lequel l'application s'exécute
|
| 15 |
EXPOSE 8001
|
| 16 |
|
| 17 |
+
# Commande pour démarrer l'application FastAPI
|
| 18 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]
|