FROM python:3.10-slim # 1. Install system dependencies RUN apt-get update && apt-get install -y \ build-essential git git-lfs ffmpeg libsm6 libxext6 cmake libgl1 libglib2.0-0 curl \ && rm -rf /var/lib/apt/lists/* # 2. CREATE A FRESH WORKDIR (This avoids the "directory not empty" error) WORKDIR /puppeteer_root # 3. EXACT GITHUB INSTRUCTION: Clone with recursive submodules # We clone into the current directory (.) RUN git clone --recursive https://github.com/Seed3D/Puppeteer.git . # 4. VERIFY: Fail the build immediately if the script isn't there RUN if [ ! -f "demo_rigging.sh" ]; then echo "CLONE FAILED" && exit 1; fi # 5. EXACT GITHUB INSTRUCTION: Install Torch & Requirements RUN pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cpu RUN pip install -r requirements.txt RUN pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.1+cpu.html RUN pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cpu_pyt211/download.html RUN pip install gradio==5.23.1 tetgen mesh2sdf # 6. WEIGHTS: Download the missing brain file RUN mkdir -p third_partys/Michelangelo/checkpoints/aligned_shape_latents/ && \ curl -L -o third_partys/Michelangelo/checkpoints/aligned_shape_latents/shapevae-256.ckpt \ https://huggingface.co/ZixiangZ/Michelangelo/resolve/main/aligned_shape_latents/shapevae-256.ckpt # 7. CPU PATCH: Change .cuda() to .to('cpu') in all files RUN find . -type f -name "*.py" -exec sed -i 's/\.cuda()/.to("cpu")/g' {} + RUN find . -type f -name "*.py" -exec sed -i "s/'cuda'/ 'cpu'/g" {} + RUN chmod +x demo_rigging.sh # 8. ENVIRONMENT ENV PYTHONPATH="/puppeteer_root:/puppeteer_root/skeleton:/puppeteer_root/skinning" ENV CUDA_VISIBLE_DEVICES="" # 9. COPY YOUR APP.PY INTO THE NEW ROOT COPY app.py /puppeteer_root/app.py CMD ["python", "app.py"]