luigui300's picture
Fix OpenCV headless force reinstall
282060f
Raw History Blame Contribute Delete
806 Bytes
FROM python:3.10.13-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 \
--index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir torch-scatter torch-sparse torch-cluster \
-f https://data.pyg.org/whl/torch-2.5.1+cpu.html && \
pip install --no-cache-dir torch-geometric==2.7.0 && \
pip uninstall -y opencv-python opencv-python-headless || true && \
pip install --no-cache-dir opencv-python-headless==4.11.0.86 && \
pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["python", "app.py"]