FROM python:3.12-slim ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ HF_SPACE=true \ STORAGE_ENABLED=false WORKDIR /app # System deps (keep minimal; add build-essential only if you need wheels compiled) RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && rm -rf /var/lib/apt/lists/* # Copy code COPY . /app # Install dependencies # Prefer requirements.txt if you have it; otherwise generate one from pyproject for Docker usage. RUN pip install --upgrade pip \ && pip install -r requirements.txt # HuggingFace Spaces uses port 7860 EXPOSE 7860 CMD ["python", "app.py"]