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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -25
Dockerfile CHANGED
@@ -1,41 +1,37 @@
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"]
 
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
+
8
+ # --- Install system-level dependencies ---
9
  RUN apt-get update && apt-get install -y \
10
+ git ffmpeg curl unzip \
11
+ libgl1-mesa-glx \
12
+ libxext6 \
13
+ && apt-get clean
14
 
15
+ # --- Set working directory ---
16
  WORKDIR /app
17
 
18
+ # --- Copy all files ---
19
  COPY . /app
20
 
21
+ # --- Create required cache/weights directories with permissions ---
22
+ RUN mkdir -p /app/hf_cache /app/ckpt && chmod -R 777 /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
+ RUN pip install --no-binary :all: av # Optional: rebuild AV from source
29
+
30
+ # --- Expose default Gradio port ---
31
 
 
 
 
 
 
32
 
 
 
33
 
 
34
  EXPOSE 7860
35
 
36
+ # --- Start the app ---
37
+ CMD ["python", "app.py"]