| FROM --platform=linux/amd64 python:3.7-slim | |
| # System dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| redis-server \ | |
| libxrender1 \ | |
| libxext6 \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy all application code | |
| COPY . . | |
| # HF Spaces requires port 7860 | |
| EXPOSE 7860 | |
| # Startup: Redis + worker + Flask | |
| CMD ["bash", "start.sh"] | |