JimSmith007 commited on
Commit
6f08fb5
·
1 Parent(s): 941d7ce

Ajout de libgl1 pour corriger l'erreur OpenCV

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -1,5 +1,8 @@
1
  FROM python:3.12.10
2
 
 
 
 
3
  # Crée un utilisateur non root
4
  RUN useradd -m user
5
  USER user
@@ -8,7 +11,7 @@ ENV PATH="/home/user/.local/bin:$PATH"
8
  # Répertoire de travail
9
  WORKDIR /home/user/app
10
 
11
- # Installe les dépendances
12
  COPY --chown=user requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir -r requirements.txt
14
  RUN pip install --no-cache-dir albumentations[imgaug] albumentations[opencv] albumentations[pytorch]
@@ -17,4 +20,4 @@ RUN pip install --no-cache-dir albumentations[imgaug] albumentations[opencv] alb
17
  COPY --chown=user . .
18
 
19
  # Lance l'app FastAPI sur le port 7860
20
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.12.10
2
 
3
+ # Installe la dépendance système requise par OpenCV
4
+ RUN apt-get update && apt-get install -y libgl1
5
+
6
  # Crée un utilisateur non root
7
  RUN useradd -m user
8
  USER user
 
11
  # Répertoire de travail
12
  WORKDIR /home/user/app
13
 
14
+ # Installe les dépendances Python
15
  COPY --chown=user requirements.txt requirements.txt
16
  RUN pip install --no-cache-dir -r requirements.txt
17
  RUN pip install --no-cache-dir albumentations[imgaug] albumentations[opencv] albumentations[pytorch]
 
20
  COPY --chown=user . .
21
 
22
  # Lance l'app FastAPI sur le port 7860
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]