FROM python:3.9-slim # Create the user first so we can use it for ownership RUN useradd -m -u 1000 user WORKDIR /app COPY --chown=user requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY --chown=user . . USER user ENV PATH="/home/user/.local/bin:$PATH" CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]