FROM python:3.10-slim WORKDIR /app # System deps for spaCy, git-backed scanning, and build tools RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential gcc git curl ca-certificates && \ rm -rf /var/lib/apt/lists/* # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt RUN python -m spacy download en_core_web_lg || python -m spacy download en_core_web_sm # Copy application files COPY . . # HuggingFace Spaces uses port 7860 EXPOSE 7860 # Start server on port 7860 CMD sh -c "uvicorn server:app --host 0.0.0.0 --port ${PORT:-7860} --workers ${WEB_CONCURRENCY:-1} --timeout-keep-alive 30"