Update Dockerfile
Browse files- Dockerfile +13 -12
Dockerfile
CHANGED
|
@@ -8,36 +8,37 @@ 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 + toolchain +
|
| 12 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 13 |
-
python3.11 python3.11-venv python3-pip \
|
| 14 |
git git-lfs build-essential ninja-build cmake pkg-config \
|
| 15 |
libgl1 libsm6 libxext6 ffmpeg \
|
| 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
|
| 20 |
-
|
| 21 |
-
# Python build deps needed by flash-attn setup
|
| 22 |
-
RUN pip install -U setuptools wheel packaging pybind11 ninja cmake psutil
|
| 23 |
|
| 24 |
WORKDIR /app
|
| 25 |
COPY requirements.txt /app/requirements.txt
|
| 26 |
|
| 27 |
-
# 1) Install Torch (CUDA 12.1) first
|
| 28 |
RUN pip install --index-url https://download.pytorch.org/whl/cu121 \
|
| 29 |
torch==2.5.1 torchvision==0.20.1
|
| 30 |
|
| 31 |
# 2) Build/install flash-attn against existing Torch/CUDA
|
| 32 |
RUN pip install --no-build-isolation --no-cache-dir flash-attn==2.7.3
|
| 33 |
|
| 34 |
-
# 3)
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
#
|
| 38 |
-
RUN pip install git+https://github.com/joanrod/star-vector.git@main
|
| 39 |
|
| 40 |
-
#
|
| 41 |
COPY . /app
|
| 42 |
|
| 43 |
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 (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 \
|
| 15 |
libgl1 libsm6 libxext6 ffmpeg \
|
| 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
|