roll-ai commited on
Commit
fbe1ab9
·
verified ·
1 Parent(s): 17a613b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -1,5 +1,4 @@
1
  FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
2
-
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  PATH=/opt/conda/bin:$PATH \
5
  CUDA_HOME=/usr/local/cuda
@@ -13,22 +12,25 @@ RUN apt-get update && apt-get install -y \
13
  RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
14
  bash /tmp/miniconda.sh -b -p /opt/conda && \
15
  rm /tmp/miniconda.sh && \
16
- /opt/conda/bin/conda clean -afy
17
 
18
- # Create conda env
19
- RUN conda create -n appenv python=3.10 -y && conda clean -afy
20
- SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
 
21
 
22
- # Install ffmpeg from conda-forge
23
- RUN conda install ffmpeg=7 -c conda-forge -y && conda clean -afy
 
24
 
25
- # Copy project
26
  WORKDIR /workspace
27
  COPY requirements.txt .
28
 
29
- # Install Python dependencies (flash-attn will now compile)
30
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
31
 
 
32
  COPY . .
33
 
34
  CMD ["conda", "run", "--no-capture-output", "-n", "appenv", "python", "finetune/app.py"]
 
1
  FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
 
2
  ENV DEBIAN_FRONTEND=noninteractive \
3
  PATH=/opt/conda/bin:$PATH \
4
  CUDA_HOME=/usr/local/cuda
 
12
  RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
13
  bash /tmp/miniconda.sh -b -p /opt/conda && \
14
  rm /tmp/miniconda.sh && \
15
+ conda clean -afy
16
 
17
+ # Configure conda to avoid Anaconda TOS prompt
18
+ RUN conda config --remove channels defaults && \
19
+ conda config --add channels conda-forge && \
20
+ conda config --set channel_priority strict
21
 
22
+ # Create conda environment with Python + ffmpeg from conda-forge
23
+ RUN conda create -n appenv python=3.10 ffmpeg=7 -y && conda clean -afy
24
+ SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
25
 
26
+ # Copy requirements first for layer caching
27
  WORKDIR /workspace
28
  COPY requirements.txt .
29
 
30
+ # Install Python dependencies (flash-attn will compile since we have nvcc)
31
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
32
 
33
+ # Copy remaining code
34
  COPY . .
35
 
36
  CMD ["conda", "run", "--no-capture-output", "-n", "appenv", "python", "finetune/app.py"]