Spaces:
Running
Running
Commit
·
0271343
1
Parent(s):
8be6b3a
Fix libGL error for OpenCV
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
|
@@ -1,24 +1,28 @@
|
|
| 1 |
# 1. Image Python stable
|
| 2 |
FROM python:3.10
|
| 3 |
|
| 4 |
-
# 2. Dossier de travail
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY ./backend/requirements.txt /code/requirements.txt
|
| 9 |
|
| 10 |
-
# 4. Installation des dépendances
|
| 11 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 12 |
pip install --no-cache-dir -r /code/requirements.txt
|
| 13 |
|
| 14 |
-
# 5. Création du dossier pour les poids DeepFace
|
| 15 |
RUN mkdir -p /root/.deepface/weights
|
| 16 |
|
| 17 |
# 6. Copie du code backend
|
| 18 |
COPY ./backend /code
|
| 19 |
|
| 20 |
-
# 7. Ouverture du port
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
-
# 8. Lancement
|
| 24 |
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# 1. Image Python stable
|
| 2 |
FROM python:3.10
|
| 3 |
|
| 4 |
+
# 2. Dossier de travail
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
+
# --- CORRECTION CRITIQUE ICI ---
|
| 8 |
+
# On installe les librairies système manquantes pour OpenCV (libGL)
|
| 9 |
+
RUN apt-get update && apt-get install -y libgl1-mesa-glx libglib2.0-0
|
| 10 |
+
|
| 11 |
+
# 3. Copie des requirements
|
| 12 |
COPY ./backend/requirements.txt /code/requirements.txt
|
| 13 |
|
| 14 |
+
# 4. Installation des dépendances Python
|
| 15 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 16 |
pip install --no-cache-dir -r /code/requirements.txt
|
| 17 |
|
| 18 |
+
# 5. Création du dossier pour les poids DeepFace
|
| 19 |
RUN mkdir -p /root/.deepface/weights
|
| 20 |
|
| 21 |
# 6. Copie du code backend
|
| 22 |
COPY ./backend /code
|
| 23 |
|
| 24 |
+
# 7. Ouverture du port
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
+
# 8. Lancement
|
| 28 |
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|