vds-backend / Dockerfile
ammar101's picture
refactor: move sam_3d_body inside avatar/ for cleaner structure, resolve via PYTHONPATH
afe69e8
Raw
History Blame Contribute Delete
2.29 kB
FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-devel
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app/avatar
WORKDIR /app
# ── System dependencies ───────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y \
git \
curl \
ffmpeg \
libgl1 \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libosmesa6-dev \
libglfw3 \
libglfw3-dev \
zstd \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# ── Install Ollama binary ─────────────────────────────────────────────────────
RUN curl -fsSL https://ollama.com/install.sh | sh
# ── Upgrade pip + fix setuptools for Cython extensions ───────────────────────
RUN pip install --upgrade pip "setuptools<70" wheel cython "numpy<2.0.0"
# ── Upgrade PyTorch >= 2.4.0 (SAM requires UInt32Storage) ────────────────────
RUN pip install "torch>=2.4.0" "torchvision>=0.19.0" --index-url https://download.pytorch.org/whl/cu121
# ── Install detectron2 from source (required by SAM internals) ────────────────
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git@a1ce2f9' \
--no-build-isolation --no-deps
# ── Python dependencies ───────────────────────────────────────────────────────
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ── Copy application code ─────────────────────────────────────────────────────
COPY . .
# ── Make startup script executable ───────────────────────────────────────────
RUN chmod +x start.sh
# HF Spaces requires port 7860
EXPOSE 7860
CMD ["./start.sh"]