roll-ai commited on
Commit
0965780
·
verified ·
1 Parent(s): cd34e41

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -7
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
2
- # Non-interactive APT installs
3
- # Avoid any apt interactive prompts
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  PATH=/opt/conda/bin:$PATH \
6
  CUDA_HOME=/usr/local/cuda
@@ -26,11 +26,10 @@ RUN rm -f /opt/conda/.condarc && \
26
  conda config --add channels conda-forge && \
27
  conda config --set channel_priority strict
28
 
29
- # This prevents Conda from auto-adding defaults during env creation
30
  ENV CONDA_FORGE=1 \
31
  CONDA_AUTO_UPDATE_CONDA=false
32
 
33
- # Create environment using ONLY conda-forge
34
  RUN conda create --override-channels -n appenv -c conda-forge python=3.10 ffmpeg=7 -y && conda clean -afy
35
  SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
36
 
@@ -38,10 +37,15 @@ SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
38
  WORKDIR /workspace
39
  COPY requirements.txt .
40
 
41
- # Install pip dependencies
42
- RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
 
 
 
 
43
 
44
- # Copy rest of code
45
  COPY . .
46
 
 
47
  CMD ["conda", "run", "--no-capture-output", "-n", "appenv", "python", "finetune/gradio_app.py"]
 
1
  FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
2
+
3
+ # Avoid apt interactive prompts
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  PATH=/opt/conda/bin:$PATH \
6
  CUDA_HOME=/usr/local/cuda
 
26
  conda config --add channels conda-forge && \
27
  conda config --set channel_priority strict
28
 
 
29
  ENV CONDA_FORGE=1 \
30
  CONDA_AUTO_UPDATE_CONDA=false
31
 
32
+ # Create env with Python 3.10
33
  RUN conda create --override-channels -n appenv -c conda-forge python=3.10 ffmpeg=7 -y && conda clean -afy
34
  SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
35
 
 
37
  WORKDIR /workspace
38
  COPY requirements.txt .
39
 
40
+ # Pre-install torch so flash-attn doesn't fail
41
+ RUN pip install --upgrade pip && \
42
+ pip install torch==2.6.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
43
+
44
+ # Install the rest of the dependencies
45
+ RUN pip install --no-cache-dir -r requirements.txt
46
 
47
+ # Copy project code
48
  COPY . .
49
 
50
+ # Run app
51
  CMD ["conda", "run", "--no-capture-output", "-n", "appenv", "python", "finetune/gradio_app.py"]