Spaces:
Paused
Paused
| # ============================================================ | |
| # Puppeteer GPU API Dockerfile (Final, CUDA 11.8 + A10G Ready) | |
| # ============================================================ | |
| FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 | |
| # ------------------------------------------------------------ | |
| # OS Dependencies | |
| # ------------------------------------------------------------ | |
| RUN apt-get update && apt-get install -y \ | |
| python3 python3-pip python3-venv \ | |
| git wget curl unzip ffmpeg bash \ | |
| libgl1 libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && ln -sf /usr/bin/python3 /usr/bin/python | |
| # ------------------------------------------------------------ | |
| # Environment Variables | |
| # ------------------------------------------------------------ | |
| ENV PIP_NO_CACHE_DIR=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| OMP_NUM_THREADS=1 \ | |
| MKL_THREADING_LAYER=SEQUENTIAL \ | |
| TMP_IN_DIR=/data/in \ | |
| RESULT_DIR=/data/results | |
| # ------------------------------------------------------------ | |
| # Upgrade pip | |
| # ------------------------------------------------------------ | |
| RUN python -m pip install --upgrade pip | |
| # ------------------------------------------------------------ | |
| # Build Cache Busting (force rebuild) | |
| # ------------------------------------------------------------ | |
| ARG CACHE_BUST=2025-11-05-03-30 | |
| # ------------------------------------------------------------ | |
| # Work Directory | |
| # ------------------------------------------------------------ | |
| WORKDIR /app | |
| # ------------------------------------------------------------ | |
| # Python Dependencies (Torch 제외) | |
| # ------------------------------------------------------------ | |
| COPY requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| # ------------------------------------------------------------ | |
| # CUDA용 PyTorch 설치 (cu118) | |
| # ------------------------------------------------------------ | |
| RUN pip uninstall -y torch torchvision torchaudio || true | |
| RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu118 \ | |
| torch torchvision torchaudio | |
| # ------------------------------------------------------------ | |
| # App Source | |
| # ------------------------------------------------------------ | |
| COPY app.py /app/app.py | |
| # ------------------------------------------------------------ | |
| # Puppeteer Vendor (벤더 코드) | |
| # ------------------------------------------------------------ | |
| COPY third_party/Puppeteer /app/Puppeteer | |
| RUN chmod +x /app/Puppeteer/demo_rigging.sh || true | |
| # ------------------------------------------------------------ | |
| # Python Path / third_partys Compatibility | |
| # ------------------------------------------------------------ | |
| ENV PYTHONPATH=/app:/app/Puppeteer:/app/Puppeteer/third_party:$PYTHONPATH | |
| RUN ln -s /app/Puppeteer/third_party /app/third_partys || true \ | |
| && touch /app/Puppeteer/third_party/__init__.py | |
| # ------------------------------------------------------------ | |
| # Writable Paths | |
| # ------------------------------------------------------------ | |
| RUN mkdir -p /data/in /data/results && chmod -R 777 /data | |
| # ------------------------------------------------------------ | |
| # Entrypoint (cd /app + preflight import) | |
| # ------------------------------------------------------------ | |
| RUN printf '#!/bin/bash\nset -euo pipefail\ncd /app\npython -c "import importlib, sys; import app; print(\\"[boot] app imported OK\\")" || exit 1\nuvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}\n' > /app/run.sh \ | |
| && chmod +x /app/run.sh | |
| EXPOSE 7860 | |
| CMD ["sh", "-c", "/app/run.sh"] | |
| # ------------------------------------------------------------ | |
| # End of Dockerfile | |
| # force rebuild 2025-11-05 | |
| # ------------------------------------------------------------ | |