FROM python:3.10-slim # Install system dependencies RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ git \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # 1. Force install CPU-only version of Torch first # This prevents pip from trying to download the 5GB+ NVIDIA drivers RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu # 2. Clone the repo RUN git clone https://github.com/rupeshs/fastsdcpu.git . # 3. Install requirements but skip the heavy torch/cuda resolution # We use --no-deps or specific constraints to keep the build fast RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir openvino-dev fastapi uvicorn # Hugging Face Spaces run on port 7860 EXPOSE 7860 # Command to start the web UI CMD ["python3", "src/app.py", "--host", "0.0.0.0", "--port", "7860"]