Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +21 -13
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
#
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Install system dependencies
|
|
@@ -8,25 +8,33 @@ RUN apt-get update && apt-get install -y \
|
|
| 8 |
libsm6 \
|
| 9 |
libxext6 \
|
| 10 |
cmake \
|
|
|
|
|
|
|
|
|
|
| 11 |
libgl1-mesa-glx \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
RUN pip install --no-cache-dir
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# Set the working directory
|
| 26 |
WORKDIR /app
|
| 27 |
|
| 28 |
-
# Copy
|
| 29 |
COPY . .
|
| 30 |
|
| 31 |
-
#
|
|
|
|
|
|
|
|
|
|
| 32 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Base image for Python
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Install system dependencies
|
|
|
|
| 8 |
libsm6 \
|
| 9 |
libxext6 \
|
| 10 |
cmake \
|
| 11 |
+
gcc \
|
| 12 |
+
g++ \
|
| 13 |
+
ninja-build \
|
| 14 |
libgl1-mesa-glx \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Upgrade pip
|
| 18 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 19 |
+
|
| 20 |
+
# Install PyTorch and torchvision
|
| 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 |
+
# Install other Python dependencies
|
| 27 |
+
COPY requirements.txt /tmp/requirements.txt
|
| 28 |
+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 29 |
|
| 30 |
# Set the working directory
|
| 31 |
WORKDIR /app
|
| 32 |
|
| 33 |
+
# Copy application files
|
| 34 |
COPY . .
|
| 35 |
|
| 36 |
+
# Expose port for Gradio
|
| 37 |
+
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
# Run the application
|
| 40 |
CMD ["python", "app.py"]
|