zero123plus-v1.2 / Dockerfile
maple-shaft's picture
dockerizing
31e32d0
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /opt/app
# System deps
RUN apt-get update && apt-get install -y \
git \
python3 \
python3-pip \
python3-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/python3 /usr/bin/python
# Upgrade pip
RUN pip install --upgrade pip setuptools wheel
# ---- Torch FIRST (critical) ----
RUN pip install torch torchvision torchaudio \
--index-url https://download.pytorch.org/whl/cu121
# ---- Clone pinned Hunyuan3D ----
ARG HY3D_COMMIT=e2df0625bda7efd5f1daba8f3f2a4cb3d9ac85f8
RUN git clone https://github.com/tencent/Hunyuan3D-2.git && \
cd Hunyuan3D-2 && git checkout ${HY3D_COMMIT}
WORKDIR /opt/app/Hunyuan3D-2
# ---- Install root package ----
RUN pip install -e .
# ---- Build CUDA extensions ----
RUN pip install ./hy3dgen/texgen/custom_rasterizer/ops
RUN pip install ./hy3dgen/texgen/differentiable_renderer/ops
# ---- Copy HF handler last (better caching) ----
WORKDIR /opt/app
COPY handler.py .
ENV PYTHONPATH=/opt/app/Hunyuan3D-2