Spaces:
Build error
Build error
File size: 893 Bytes
b1437f0 a8e4304 b1437f0 e4c2a69 b1437f0 a8e4304 3516513 1a6331d 3516513 1a6331d 3516513 1a6331d b1437f0 3516513 a8e4304 3516513 a8e4304 b1437f0 a8e4304 3516513 1a6331d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
libsm6 \
libxext6 \
g++ \
build-essential \
libgl1 \
libglib2.0-0 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy only requirements first to leverage Docker caching
COPY requirements.txt ./
# Install PyTorch (CPU version)
RUN pip install --no-cache-dir torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2
# Install OpenMMLab dependencies
RUN pip install --no-cache-dir mmengine mmcv-full openmim
# Install MMSegmentation using mim AFTER torch is present
RUN mim install mmsegmentation
# Copy rest of the application code
COPY . .
# Install remaining Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose Gradio port
EXPOSE 7860
# Start the app
CMD ["python", "app.py"]
|