FROM python:3.11-slim # HF Spaces required port ENV PORT=7860 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ MOCK_DATA=true # HF Spaces runs as user 1000 RUN useradd -m -u 1000 user WORKDIR /home/user/app # Install deps first for layer caching COPY --chown=user:user requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the app COPY --chown=user:user src ./src COPY --chown=user:user assets ./assets COPY --chown=user:user app.py . USER user EXPOSE 7860 CMD ["python", "app.py"]