File size: 701 Bytes
5f12d8e 71692ad 5f12d8e 71692ad 5f12d8e 0e17006 5f12d8e 1de2238 5f12d8e 33da647 0e17006 5f12d8e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# System deps for OpenCV/ffmpeg and build tools for insightface
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libgl1 \
build-essential \
g++ \
make \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy source
COPY . .
EXPOSE 7860
# Optional: set at runtime
ENV FACE_SWAP_API_KEY=""
ENV OMP_NUM_THREADS=1
CMD ["python3", "-m", "uvicorn", "fastapi_app:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "1800", "--timeout-graceful-shutdown", "30"]
|