RealCam-I2V / Dockerfile
roll-ai's picture
Update Dockerfile
9470c01 verified
raw
history blame
1.98 kB
# ==== GPU base (CUDA 12.1 + cuDNN) ====
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
HF_HOME=/root/.cache/huggingface \
TRANSFORMERS_CACHE=/root/.cache/huggingface/transformers \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_SERVER_PORT=8080 \
DISPLAY=:99
# ---- System deps (ffmpeg + headless GL/X) ----
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip python3-venv \
git git-lfs \
ffmpeg \
libgl1 \
libgl1-mesa-dri \
libglib2.0-0 \
xvfb \
&& git lfs install \
&& rm -rf /var/lib/apt/lists/*
# ---- Workdir & copy requirements first (cache-friendly) ----
WORKDIR /app
COPY requirements.txt /app/requirements.txt
# ---- Python deps (Torch CUDA 12.1 first) ----
RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cu121 \
torch torchvision torchaudio \
&& python3 -m pip install -r requirements.txt \
&& python3 -m pip install huggingface_hub imageio-ffmpeg
# ---- App code ----
# Expect: gradio_app.py (updated), image_to_video.py, demo/, etc.
COPY . /app
# ---- Ports & default envs ----
EXPOSE 8080
ENV DEVICE=cuda \
SAVE_FPS=16 \
RESULT_DIR=/app/results \
MODEL_META_PATH=demo/models.json \
EXAMPLE_META_PATH=demo/examples.json \
CAMERA_POSE_META_PATH=demo/camera_poses.json \
DEPTH_MODEL_PATH=pretrained/Metric3D/metric_depth_vit_large_800k.pth \
CAPTION_MODEL_PATH=pretrained/Qwen2.5-VL-7B-Instruct
# Optional (set at runtime to auto-download via gradio_app.py):
# ENV REPO_COGVIDEOX=THUDM/CogVideoX1.5-5B-I2V
# ENV REPO_METRIC3D=JUGGHM/Metric3D
# ENV REPO_QWEN_VL=Qwen/Qwen2.5-VL-7B-Instruct
# ENV REPO_REALCAM=MuteApo/RealCam-I2V
# ENV HF_TOKEN= # pass at runtime; don't bake secrets
# (Option A) simplest possible
CMD ["python", "finetune/gradio_app.py"]