FROM python:3.12-slim RUN useradd -m -u 1000 user WORKDIR /home/user/app COPY --chown=user requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY --chown=user app ./app USER user ENV PORT=7860 EXPOSE 7860 CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT} --proxy-headers --forwarded-allow-ips='*'"]