| FROM python:3.10-slim | |
| WORKDIR /app | |
| # System dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install CPU-only PyTorch first (keeps image small) | |
| RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
| # Install rest of dependencies | |
| COPY requirements.txt . | |
| RUN pip install -r requirements.txt | |
| # Copy project files | |
| COPY . . | |
| # HuggingFace Spaces requires port 7860 | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |