roll-ai commited on
Commit
8f2e07d
·
verified ·
1 Parent(s): 9470c01

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -24
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
- # ==== GPU base (CUDA 12.1 + cuDNN) ====
2
  FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive \
@@ -11,34 +10,27 @@ ENV DEBIAN_FRONTEND=noninteractive \
11
  GRADIO_SERVER_PORT=8080 \
12
  DISPLAY=:99
13
 
14
- # ---- System deps (ffmpeg + headless GL/X) ----
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
  python3 python3-pip python3-venv \
17
  git git-lfs \
18
- ffmpeg \
19
- libgl1 \
20
- libgl1-mesa-dri \
21
- libglib2.0-0 \
22
- xvfb \
23
  && git lfs install \
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
- # ---- Workdir & copy requirements first (cache-friendly) ----
27
  WORKDIR /app
28
  COPY requirements.txt /app/requirements.txt
29
 
30
- # ---- Python deps (Torch CUDA 12.1 first) ----
31
  RUN python3 -m pip install --upgrade pip \
32
- && python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cu121 \
33
- torch torchvision torchaudio \
34
- && python3 -m pip install -r requirements.txt \
35
  && python3 -m pip install huggingface_hub imageio-ffmpeg
36
 
37
- # ---- App code ----
38
- # Expect: gradio_app.py (updated), image_to_video.py, demo/, etc.
39
  COPY . /app
40
 
41
- # ---- Ports & default envs ----
42
  EXPOSE 8080
43
  ENV DEVICE=cuda \
44
  SAVE_FPS=16 \
@@ -49,12 +41,4 @@ ENV DEVICE=cuda \
49
  DEPTH_MODEL_PATH=pretrained/Metric3D/metric_depth_vit_large_800k.pth \
50
  CAPTION_MODEL_PATH=pretrained/Qwen2.5-VL-7B-Instruct
51
 
52
- # Optional (set at runtime to auto-download via gradio_app.py):
53
- # ENV REPO_COGVIDEOX=THUDM/CogVideoX1.5-5B-I2V
54
- # ENV REPO_METRIC3D=JUGGHM/Metric3D
55
- # ENV REPO_QWEN_VL=Qwen/Qwen2.5-VL-7B-Instruct
56
- # ENV REPO_REALCAM=MuteApo/RealCam-I2V
57
- # ENV HF_TOKEN= # pass at runtime; don't bake secrets
58
-
59
- # (Option A) simplest possible
60
- CMD ["python", "finetune/gradio_app.py"]
 
 
1
  FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
 
10
  GRADIO_SERVER_PORT=8080 \
11
  DISPLAY=:99
12
 
13
+ # System deps
14
  RUN apt-get update && apt-get install -y --no-install-recommends \
15
  python3 python3-pip python3-venv \
16
  git git-lfs \
17
+ ffmpeg libgl1 libgl1-mesa-dri libglib2.0-0 xvfb \
 
 
 
 
18
  && git lfs install \
19
  && rm -rf /var/lib/apt/lists/*
20
 
 
21
  WORKDIR /app
22
  COPY requirements.txt /app/requirements.txt
23
 
24
+ # Torch (CUDA 12.1) first, then other deps (excluding deepspeed)
25
  RUN python3 -m pip install --upgrade pip \
26
+ && python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cu121 torch torchvision torchaudio \
27
+ && awk '!/^ *#/ && !/deepspeed/ {print $0}' requirements.txt > requirements.infer.txt \
28
+ && python3 -m pip install -r requirements.infer.txt \
29
  && python3 -m pip install huggingface_hub imageio-ffmpeg
30
 
31
+ # App code
 
32
  COPY . /app
33
 
 
34
  EXPOSE 8080
35
  ENV DEVICE=cuda \
36
  SAVE_FPS=16 \
 
41
  DEPTH_MODEL_PATH=pretrained/Metric3D/metric_depth_vit_large_800k.pth \
42
  CAPTION_MODEL_PATH=pretrained/Qwen2.5-VL-7B-Instruct
43
 
44
+ CMD ["bash", "-lc", "xvfb-run -s '-screen 0 1280x720x24' python3 gradio_app.py"]