FROM python:3.11-slim WORKDIR /app COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt gunicorn COPY . . EXPOSE 7860 RUN useradd -m -u 1000 user RUN chown -R user:user /app USER user CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120"]