pabbelt commited on
Commit
375543c
·
verified ·
1 Parent(s): 8697e10

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -9
Dockerfile CHANGED
@@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
8
  TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;8.9" \
9
  CMAKE_BUILD_PARALLEL_LEVEL=8
10
 
11
- # Python 3.11 + headers + toolchain + Cairo dev (for svglib/rlpycairo)
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  python3.11 python3.11-venv python3.11-dev python3-pip \
14
  git git-lfs build-essential ninja-build cmake pkg-config \
@@ -16,29 +16,29 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
16
  libcairo2-dev libpango1.0-dev libffi-dev \
17
  && rm -rf /var/lib/apt/lists/* && git lfs install \
18
  && ln -sf /usr/bin/python3.11 /usr/bin/python \
19
- && python -m pip install -U pip wheel setuptools packaging pybind11
 
20
 
21
  WORKDIR /app
22
  COPY requirements.txt /app/requirements.txt
23
 
24
- # 1) Install Torch (CUDA 12.1) first so flash-attn can find headers/libs
25
  RUN pip install --index-url https://download.pytorch.org/whl/cu121 \
26
  torch==2.5.1 torchvision==0.20.1
27
 
28
- # 2) Build/install flash-attn against existing Torch/CUDA
29
  RUN pip install --no-build-isolation --no-cache-dir flash-attn==2.7.3
30
 
31
- # 3) Pre-install Cairo stack from wheels to avoid building pycairo
32
- # (if wheels exist for cp311/manylinux, this short-circuits Meson)
33
  RUN pip install --no-cache-dir pycairo==1.26.0 rlpycairo==0.4.0 svglib==1.6.0
34
 
35
- # 4) Rest of your deps (no torch here)
36
  RUN pip install --no-cache-dir -r requirements.txt
37
 
38
- # 5) Install StarVector package last (now its extras resolve cleanly)
39
  RUN pip install --no-cache-dir git+https://github.com/joanrod/star-vector.git@main
40
 
41
- # 6) Copy app code after deps (better caching)
42
  COPY . /app
43
 
44
  ENV PORT=7860
 
8
  TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;8.9" \
9
  CMAKE_BUILD_PARALLEL_LEVEL=8
10
 
11
+ # Python 3.11 + headers + toolchain + Cairo dev
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  python3.11 python3.11-venv python3.11-dev python3-pip \
14
  git git-lfs build-essential ninja-build cmake pkg-config \
 
16
  libcairo2-dev libpango1.0-dev libffi-dev \
17
  && rm -rf /var/lib/apt/lists/* && git lfs install \
18
  && ln -sf /usr/bin/python3.11 /usr/bin/python \
19
+ && python -m pip install -U pip wheel setuptools packaging pybind11 \
20
+ && python -m pip install -U psutil
21
 
22
  WORKDIR /app
23
  COPY requirements.txt /app/requirements.txt
24
 
25
+ # 1) Torch (CUDA 12.1) first
26
  RUN pip install --index-url https://download.pytorch.org/whl/cu121 \
27
  torch==2.5.1 torchvision==0.20.1
28
 
29
+ # 2) flash-attn against existing Torch/CUDA (needs psutil present)
30
  RUN pip install --no-build-isolation --no-cache-dir flash-attn==2.7.3
31
 
32
+ # 3) Pre-install Cairo Python wheels (avoid building pycairo)
 
33
  RUN pip install --no-cache-dir pycairo==1.26.0 rlpycairo==0.4.0 svglib==1.6.0
34
 
35
+ # 4) Rest of deps (no torch here)
36
  RUN pip install --no-cache-dir -r requirements.txt
37
 
38
+ # 5) StarVector package last
39
  RUN pip install --no-cache-dir git+https://github.com/joanrod/star-vector.git@main
40
 
41
+ # 6) App code
42
  COPY . /app
43
 
44
  ENV PORT=7860