dock change
Browse files- Dockerfile +12 -8
Dockerfile
CHANGED
|
@@ -1,23 +1,27 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
libgl1 \
|
| 8 |
libglib2.0-0 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
#
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 14 |
pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
# Copie
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
RUN
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Dépendances système
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
libgl1 \
|
| 8 |
libglib2.0-0 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# Dépendances Python
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 14 |
pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
# Copie des fichiers
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
+
# Utilisateur non-root requis par HuggingFace Spaces
|
| 20 |
+
RUN useradd -m -u 1000 user
|
| 21 |
+
RUN chown -R user:user /app
|
| 22 |
+
USER user
|
| 23 |
|
| 24 |
+
# Port obligatoire pour HF Spaces
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
CMD ["python", "app.py"]
|