Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
# Use a slim Python 3.10 image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
git \
|
| 7 |
ffmpeg \
|
|
@@ -17,20 +17,22 @@ RUN apt-get update && apt-get install -y \
|
|
| 17 |
# Upgrade pip
|
| 18 |
RUN pip install --no-cache-dir --upgrade pip
|
| 19 |
|
| 20 |
-
# Install
|
| 21 |
RUN pip install --no-cache-dir torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
| 22 |
|
| 23 |
-
# Install Detectron2
|
| 24 |
RUN python -m pip install git+https://github.com/facebookresearch/detectron2.git
|
| 25 |
|
| 26 |
-
#
|
| 27 |
WORKDIR /app
|
|
|
|
|
|
|
| 28 |
COPY . .
|
| 29 |
|
| 30 |
-
# Install
|
| 31 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 32 |
|
| 33 |
-
# Expose port for Gradio
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
# Run the application
|
|
|
|
| 1 |
+
# Use a slim Python 3.10 base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Install essential system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
git \
|
| 7 |
ffmpeg \
|
|
|
|
| 17 |
# Upgrade pip
|
| 18 |
RUN pip install --no-cache-dir --upgrade pip
|
| 19 |
|
| 20 |
+
# Install PyTorch and torchvision explicitly before Detectron2
|
| 21 |
RUN pip install --no-cache-dir torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
| 22 |
|
| 23 |
+
# Install Detectron2
|
| 24 |
RUN python -m pip install git+https://github.com/facebookresearch/detectron2.git
|
| 25 |
|
| 26 |
+
# Set the working directory
|
| 27 |
WORKDIR /app
|
| 28 |
+
|
| 29 |
+
# Copy application files
|
| 30 |
COPY . .
|
| 31 |
|
| 32 |
+
# Install remaining dependencies
|
| 33 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 34 |
|
| 35 |
+
# Expose the port for Gradio
|
| 36 |
EXPOSE 7860
|
| 37 |
|
| 38 |
# Run the application
|