|
|
|
|
|
FROM python:3.12-slim |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
|
ffmpeg \ |
|
|
libsm6 \ |
|
|
libxext6 \ |
|
|
libxrender-dev \ |
|
|
libgomp1 \ |
|
|
libglib2.0-0 \ |
|
|
git \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN --mount=type=secret,id=GITHUB_REPO,required=true \ |
|
|
git clone $(cat /run/secrets/GITHUB_REPO) . |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt \ |
|
|
gunicorn |
|
|
|
|
|
ENV FLASK_ENV=production |
|
|
ENV PORT=7860 |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["gunicorn", "-w", "2", "--threads", "4", "-b", "0.0.0.0:7860", "app:app"] |
|
|
|