# syntax=docker/dockerfile:1 FROM nvidia/cuda:12.1.1-cudnn-runtime-ubuntu22.04 ENV DEBIAN_FRONTEND=noninteractive \ PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ VIRTUAL_ENV=/opt/venv \ PATH="/opt/venv/bin:${PATH}" \ HF_HOME=/models/cache \ PIP_NO_CACHE_DIR=1 \ GRADIO_SERVER_NAME=0.0.0.0 RUN apt-get update && apt-get install -y --no-install-recommends \ python3.10 \ python3.10-venv \ python3-pip \ git \ build-essential \ && rm -rf /var/lib/apt/lists/* RUN python3.10 -m venv ${VIRTUAL_ENV} WORKDIR /app COPY requirements.txt . RUN pip install --upgrade pip setuptools wheel && \ pip install --extra-index-url https://download.pytorch.org/whl/cu121 torch torchvision torchaudio && \ pip install -r requirements.txt COPY . . EXPOSE 8000 EXPOSE 7860 CMD ["uvicorn", "tools.server:app", "--host", "0.0.0.0", "--port", "8000"]