roll-ai commited on
Commit
426e130
·
verified ·
1 Parent(s): bc8f7b7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -19
Dockerfile CHANGED
@@ -1,36 +1,36 @@
1
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
2
 
3
- # Install OS-level dependencies
 
 
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  git ffmpeg curl unzip \
6
- libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev \
7
- libavutil-dev libswscale-dev libswresample-dev \
 
 
 
8
  && apt-get clean
9
 
10
  # Set working directory
11
  WORKDIR /app
 
 
12
  COPY . /app
13
- RUN ls /app
14
 
15
- # Upgrade pip and install required Python packages
16
  RUN pip install --upgrade pip
17
- RUN pip install gdown av huggingface_hub
18
  RUN pip install -r requirements.txt
19
- RUN pip install --no-binary :all: av # optional: rebuild av from source
20
-
21
- # # Download ckpt weights from Hugging Face (private or public)
22
- # RUN python -c "import os; from huggingface_hub import snapshot_download; snapshot_download( repo_id='roll-ai/FloVD-weights', repo_type='dataset', local_dir='/app/ckpt', allow_patterns='ckpt/**', token=os.getenv('HF_TOKEN'))"
23
-
24
-
25
- # # Download example camera pose
26
- # RUN mkdir -p /weights/assets/manual_poses
27
- # RUN curl -L -o /weights/assets/manual_poses/example.txt https://huggingface.co/datasets/mutqa/FloVD-HF-Assets/resolve/main/example.txt
28
 
29
- # Set permissions (optional but helpful)
30
- RUN chmod -R 777 /app
31
 
32
- # Expose Gradio/Streamlit/Flask port
33
  EXPOSE 7860
34
 
35
- # Start the app
36
  CMD ["python", "app.py"]
 
1
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
2
 
3
+ # Set environment variable to control Hugging Face cache directory
4
+ ENV HF_HOME=/app/hf_cache
5
+ ENV TRANSFORMERS_CACHE=/app/hf_cache
6
+ ENV HF_TOKEN=${HF_TOKEN}
7
+
8
+ # Install system-level dependencies
9
  RUN apt-get update && apt-get install -y \
10
  git ffmpeg curl unzip \
11
+ libgl1-mesa-glx \
12
+ libglib2.0-0 \
13
+ libsm6 \
14
+ libxrender1 \
15
+ libxext6 \
16
  && apt-get clean
17
 
18
  # Set working directory
19
  WORKDIR /app
20
+
21
+ # Copy project files
22
  COPY . /app
 
23
 
24
+ # Install Python dependencies
25
  RUN pip install --upgrade pip
 
26
  RUN pip install -r requirements.txt
27
+ RUN pip install av huggingface_hub
 
 
 
 
 
 
 
 
28
 
29
+ # Reinstall av from source if needed
30
+ RUN pip install --no-binary :all: av
31
 
32
+ # Expose Gradio default port
33
  EXPOSE 7860
34
 
35
+ # Run the app
36
  CMD ["python", "app.py"]