Update Dockerfile
Browse files- Dockerfile +5 -2
Dockerfile
CHANGED
@@ -6,11 +6,13 @@ FROM python:3.11-slim
|
|
6 |
ENV FORCE_REBUILD=2025-08-22-17h12
|
7 |
|
8 |
# (1) Dépendances système (FFmpeg + libs utiles à opencv-python-headless)
|
|
|
9 |
RUN apt-get update \
|
10 |
&& apt-get install -y --no-install-recommends \
|
11 |
ffmpeg \
|
12 |
libglib2.0-0 \
|
13 |
libgomp1 \
|
|
|
14 |
wget \
|
15 |
git \
|
16 |
unzip \
|
@@ -19,9 +21,10 @@ RUN apt-get update \
|
|
19 |
# (2) Dossier de travail
|
20 |
WORKDIR /app
|
21 |
|
22 |
-
#
|
23 |
ENV HF_HOME=/home/user/.cache/huggingface
|
24 |
ENV TRANSFORMERS_CACHE=/home/user/.cache/huggingface/transformers
|
|
|
25 |
|
26 |
# (3) Installer dépendances Python
|
27 |
COPY requirements.txt /app/requirements.txt
|
@@ -41,4 +44,4 @@ COPY --chown=user:user . /app
|
|
41 |
# (6) Exposer le port attendu par Spaces et lancer Uvicorn sur $PORT
|
42 |
ENV PORT=7860
|
43 |
EXPOSE 7860
|
44 |
-
CMD ["bash","-lc","uvicorn app:app --host 0.0.0.0 --port ${PORT}"]
|
|
|
6 |
ENV FORCE_REBUILD=2025-08-22-17h12
|
7 |
|
8 |
# (1) Dépendances système (FFmpeg + libs utiles à opencv-python-headless)
|
9 |
+
# + libgl1 pour éviter les erreurs libGL.so.1 (même en headless)
|
10 |
RUN apt-get update \
|
11 |
&& apt-get install -y --no-install-recommends \
|
12 |
ffmpeg \
|
13 |
libglib2.0-0 \
|
14 |
libgomp1 \
|
15 |
+
libgl1 \
|
16 |
wget \
|
17 |
git \
|
18 |
unzip \
|
|
|
21 |
# (2) Dossier de travail
|
22 |
WORKDIR /app
|
23 |
|
24 |
+
# Caches Hugging Face (cohérents et propres sous /home/user)
|
25 |
ENV HF_HOME=/home/user/.cache/huggingface
|
26 |
ENV TRANSFORMERS_CACHE=/home/user/.cache/huggingface/transformers
|
27 |
+
ENV HUGGINGFACE_HUB_CACHE=/home/user/.cache/huggingface
|
28 |
|
29 |
# (3) Installer dépendances Python
|
30 |
COPY requirements.txt /app/requirements.txt
|
|
|
44 |
# (6) Exposer le port attendu par Spaces et lancer Uvicorn sur $PORT
|
45 |
ENV PORT=7860
|
46 |
EXPOSE 7860
|
47 |
+
CMD ["bash","-lc","uvicorn app:app --host 0.0.0.0 --port ${PORT}"]
|