FROM python:3.11-slim-bookworm ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PORT=7860 WORKDIR /app RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates ffmpeg gcc python3-dev build-essential \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ RUN mkdir -p /app/downloads /app/session && chown -R 1000:1000 /app USER 1000 EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]