# ============================================ # Dockerfile # Dataset Quality Inspector Agent # Meta x Hugging Face x OpenEnv Hackathon # Deploys to HuggingFace Spaces (Docker SDK) # Port: 7860 # ============================================ FROM python:3.11-slim # Set working directory WORKDIR /app # Install system dependencies # git is required by the huggingface datasets library RUN apt-get update && apt-get install -y \ gcc \ g++ \ curl \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements first (layer cache optimisation) COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir uvicorn # Copy full project and set permissions COPY . . # Create non-root user (HF Spaces requirement) RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Expose port 7860 (HuggingFace Spaces default) EXPOSE 7860 # Health check HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=5 \ CMD curl -f http://localhost:7860/ || exit 1 # Start FastAPI server CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]