# ── Hugging Face Spaces compatible Dockerfile ───────────────────────────────── FROM python:3.11-slim # HF Spaces runs as user 1000 — set this to avoid permission errors RUN useradd -m -u 1000 user USER user # Add user's local bin to PATH ENV PATH="/home/user/.local/bin:$PATH" WORKDIR /app # Copy and install dependencies COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --user -r requirements.txt # Download NLTK data RUN python -m nltk.downloader punkt punkt_tab # Copy app files COPY --chown=user main.py . COPY --chown=user model_compressed.joblib . # Hugging Face Spaces REQUIRES port 7860 EXPOSE 7860 # Run on port 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]