FROM python:3.10-slim WORKDIR /app # Install dependencies first (Docker layer caching — faster rebuilds) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Download spaCy English model for NER-based PII masking RUN python -m spacy download en_core_web_sm # Copy app code COPY app.py . # HF Spaces requires the app to listen on port 7860 EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]