roll-ai commited on
Commit
409257b
·
verified ·
1 Parent(s): cb1cab1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -22
Dockerfile CHANGED
@@ -1,36 +1,41 @@
1
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
2
 
3
- # --- Set Hugging Face environment variables ---
 
 
4
  ENV HF_HOME=/app/hf_cache
5
  ENV TRANSFORMERS_CACHE=/app/hf_cache
 
 
6
 
7
- # --- Install system-level dependencies ---
8
  RUN apt-get update && apt-get install -y \
9
- git ffmpeg curl unzip \
10
- libgl1-mesa-glx \
11
- libglib2.0-0 \
12
- libsm6 \
13
- libxrender1 \
14
- libxext6 \
15
- && apt-get clean
16
-
17
- # --- Set working directory ---
18
  WORKDIR /app
19
 
20
- # --- Copy all files ---
21
  COPY . /app
22
 
23
- # --- Create required cache/weights directories with permissions ---
24
- RUN mkdir -p /app/hf_cache /app/ckpt && chmod -R 777 /app
 
 
 
 
 
 
 
 
 
25
 
26
- # --- Install Python dependencies ---
27
- RUN pip install --upgrade pip
28
- RUN pip install -r requirements.txt
29
- RUN pip install av huggingface_hub
30
- RUN pip install --no-binary :all: av # Optional: rebuild AV from source
31
 
32
- # --- Expose default Gradio 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
+ SHELL ["/bin/bash", "-c"]
4
+
5
+ # Environment variables for Hugging Face cache
6
  ENV HF_HOME=/app/hf_cache
7
  ENV TRANSFORMERS_CACHE=/app/hf_cache
8
+ ENV HF_TOKEN=${HF_TOKEN}
9
+ ENV PATH=/opt/conda/bin:$PATH
10
 
11
+ # Install system dependencies
12
  RUN apt-get update && apt-get install -y \
13
+ git wget curl unzip ffmpeg libgl1-mesa-glx libglib2.0-0 && \
14
+ apt-get clean
15
+
16
+ # Set up working directory as /app
 
 
 
 
 
17
  WORKDIR /app
18
 
19
+ # Copy project into /app
20
  COPY . /app
21
 
22
+ # Fix permissions for all subdirectories
23
+ RUN mkdir -p /app/pretrained /app/hf_cache /.cache/gdown && \
24
+ chmod -R 777 /app && \
25
+ chmod -R 777 /.cache && \
26
+ chmod -R 777 /root
27
+
28
+ # Create conda environment and install dependencies
29
+ COPY requirements.txt /app/requirements.txt
30
+ RUN conda create -n epic python=3.10 -y && \
31
+ conda run -n epic pip install --upgrade pip && \
32
+ conda run -n epic pip install -r /app/requirements.txt
33
 
34
+ # List contents (for debug)
35
+ RUN ls -la /app
 
 
 
36
 
37
+ # Expose Gradio default port
38
  EXPOSE 7860
39
 
40
+ # Start the Gradio app
41
+ CMD ["conda", "run", "--no-capture-output", "-n", "epic", "python", "gradio_app.py"]