FROM python:3.9-slim RUN useradd -m -u 1000 user RUN apt-get update && apt-get install -y \ ffmpeg \ libsm6 \ libxext6 \ wget \ git \ && rm -rf /var/lib/apt/lists/* WORKDIR /app USER user ENV PATH="/home/user/.local/bin:$PATH" COPY --chown=user requirements.txt . COPY --chown=user . . ENV PORT=7860 CMD ["python", "-m", "flask", "run", "--host=0.0.0.0", "--port=7860"]