Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +17 -0
Dockerfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
#on choisi une image Docker de base (notre environnement)
|
| 3 |
+
|
| 4 |
+
RUN apt-get update && apt-get install -y libgl1-mesa-glx && rm -rf /var/lib/apt/lists/*
|
| 5 |
+
#on installe les paquets systeme
|
| 6 |
+
|
| 7 |
+
WORKDIR /app #on crée le dossier de travail du docker
|
| 8 |
+
|
| 9 |
+
COPY requirements.txt . #on copie notre fichier des dependances pour les installer ensuite
|
| 10 |
+
RUN pip install --no-cache-dir -r requirements.txt #on installe les dépendances
|
| 11 |
+
|
| 12 |
+
COPY . . #on copie tout notre repo
|
| 13 |
+
|
| 14 |
+
EXPOSE 7860 # on expose le port par défaut de Hugging face pour acceder à mon API
|
| 15 |
+
|
| 16 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 17 |
+
#on lance notre serveur FastAPI
|