|
|
|
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 AS base |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
git \ |
|
build-essential \ |
|
python3-pip \ |
|
python3-dev \ |
|
python3-venv \ |
|
ffmpeg \ |
|
libgl1 \ |
|
libglib2.0-0 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
RUN pip install --upgrade pip \ |
|
&& pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
ENV HF_HOME=/tmp/huggingface |
|
ENV HF_HUB_CACHE=/tmp/huggingface/hub |
|
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers |
|
|
|
ENV NVIDIA_VISIBLE_DEVICES=all |
|
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |