FROM python:3.12-slim # HF Spaces requires a non-root user with uid 1000 RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app COPY --chown=user:user requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY --chown=user:user . . EXPOSE 7860 CMD ["python", "app/app.py"]