Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +4 -16
Dockerfile
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
# Installer les dépendances système nécessaires
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
git \
|
|
@@ -10,28 +9,17 @@ RUN apt-get update && apt-get install -y \
|
|
| 10 |
libglib2.0-0 \
|
| 11 |
python3-dev \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
-
|
| 14 |
WORKDIR /app
|
| 15 |
-
|
| 16 |
# Copier les dépendances
|
| 17 |
COPY requirements.txt /app/requirements.txt
|
| 18 |
-
|
| 19 |
-
# Installer PyTorch (version CPU uniquement)
|
| 20 |
RUN pip install --upgrade pip && \
|
| 21 |
-
pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
# Vous devrez peut-être modifier requirements.txt pour exclure Detectron2 ou utiliser grep pour le filtrer
|
| 25 |
-
RUN pip install $(grep -v "detectron2\|facebookresearch/detectron2" requirements.txt || cat requirements.txt)
|
| 26 |
-
|
| 27 |
-
# Installer Detectron2 depuis GitHub (solution officielle)
|
| 28 |
-
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
| 29 |
-
|
| 30 |
# Copier tout le code dans l'image Docker
|
| 31 |
COPY . /app
|
| 32 |
-
|
| 33 |
# Exposer le port utilisé par Gradio
|
| 34 |
EXPOSE 7860
|
| 35 |
-
|
| 36 |
# Commande pour lancer ton app Gradio (modifie selon ton script)
|
| 37 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
|
|
|
| 2 |
# Installer les dépendances système nécessaires
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
git \
|
|
|
|
| 9 |
libglib2.0-0 \
|
| 10 |
python3-dev \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
| 12 |
WORKDIR /app
|
|
|
|
| 13 |
# Copier les dépendances
|
| 14 |
COPY requirements.txt /app/requirements.txt
|
| 15 |
+
# Installation des packages dans l'ordre spécifié
|
|
|
|
| 16 |
RUN pip install --upgrade pip && \
|
| 17 |
+
pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \
|
| 18 |
+
pip install -r requirements.txt && \
|
| 19 |
+
pip install git+https://github.com/facebookresearch/detectron2.git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Copier tout le code dans l'image Docker
|
| 21 |
COPY . /app
|
|
|
|
| 22 |
# Exposer le port utilisé par Gradio
|
| 23 |
EXPOSE 7860
|
|
|
|
| 24 |
# Commande pour lancer ton app Gradio (modifie selon ton script)
|
| 25 |
CMD ["python", "app.py"]
|