Skip to content

Commit 4157119

Browse files
authored
Update Dockerfile-web
1 parent 5aa0cff commit 4157119

1 file changed

Lines changed: 12 additions & 43 deletions

File tree

Dockerfile-web

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,26 @@ ENV DEBIAN_FRONTEND=noninteractive
99
WORKDIR /workspace
1010
ENV CUDA_HOME=/usr/local/cuda
1111

12+
# 配置WEB所需环境
13+
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg
14+
RUN chmod 644 /usr/share/keyrings/nodesource.gpg
15+
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_23.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
16+
1217
# 安装依赖
13-
RUN apt update -y && apt install -y apt-utils && apt upgrade -y
14-
RUN apt install -y --no-install-recommends \
15-
libtbb-dev \
16-
libssl-dev \
17-
libcurl4-openssl-dev \
18-
libaio1 \
19-
libaio-dev \
20-
libfmt-dev \
21-
libgflags-dev \
22-
zlib1g-dev \
23-
patchelf \
24-
git \
25-
wget \
26-
vim \
27-
gcc \
28-
g++
18+
RUN apt update -y && apt install -y apt-utils && apt upgrade && apt install -y --no-install-recommends net-tools tree vim curl git git-lfs neofetch libtbb-dev libssl-dev libcurl4-openssl-dev libaio1 libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelf git wget vim gcc g++ apt-transport-https ca-certificates curl gnupg nodejs && apt-get clean && rm -rf /var/lib/apt/lists/*
2919

3020
# 安装CMake
3121
RUN wget https://github.com/Kitware/CMake/releases/download/v4.0.1/cmake-4.0.1-linux-x86_64.sh && echo y | bash cmake-4.0.1-linux-x86_64.sh && rm -rf cmake-4.0.1-linux-x86_64.sh
3222

3323
# 克隆代码
3424
RUN git clone https://github.com/kvcache-ai/ktransformers.git
35-
# 清理 apt 缓存
36-
RUN rm -rf /var/lib/apt/lists/*
37-
3825
# 进入项目目录
3926
WORKDIR /workspace/ktransformers
4027
# 初始化子模块
4128
RUN git submodule update --init --recursive
4229

4330
# 升级 pip
44-
RUN pip install --upgrade pip && pip install -U wheel setuptools
45-
46-
# 安装构建依赖
47-
RUN pip install ninja pyproject numpy cpufeature aiohttp zmq openai
48-
49-
# 安装 flash-attn(提前装可以避免后续某些编译依赖出错)
50-
RUN pip install flash-attn
51-
52-
# 安装WEB所需环境
53-
RUN apt-get update -y && apt-get install -y apt-transport-https ca-certificates curl gnupg
54-
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg
55-
RUN chmod 644 /usr/share/keyrings/nodesource.gpg
56-
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_23.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
57-
RUN apt-get update -y
58-
RUN apt-get install nodejs -y
31+
RUN pip install --upgrade pip && pip install -U wheel setuptools ninja pyproject numpy cpufeature aiohttp zmq openai flash-attn && pip cache purge
5932

6033
# 安装 WEB
6134
RUN cd /workspace/ktransformers/ktransformers/website/public && rm -rf config.js && wget https://github.com/IAMJOYBO/ktransformers/raw/refs/heads/main/config.js
@@ -68,24 +41,20 @@ RUN CPU_INSTRUCT=${CPU_INSTRUCT} \
6841
TORCH_CUDA_ARCH_LIST="8.0;8.6;8.7;8.9;9.0+PTX" \
6942
pip install . --no-build-isolation --verbose
7043

71-
RUN pip install third_party/custom_flashinfer/
72-
# 清理 pip 缓存
73-
RUN pip cache purge
44+
RUN pip install third_party/custom_flashinfer/ && pip cache purge
7445

7546
# 拷贝 C++ 运行时库
7647
RUN cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/conda/lib/
7748

78-
# 安装部分个人使用的工具
79-
RUN apt install -y net-tools tree vim curl git git-lfs neofetch
8049
# apt修改为国内源
8150
RUN rm -rf /etc/apt/sources.list && wget https://github.com/IAMJOYBO/ktransformers/raw/refs/heads/main/sources-20.04.list -O /etc/apt/sources.list
8251
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
8352

8453
# 预下载的配置文件
85-
RUN pip install huggingface_hub modelscope
86-
RUN huggingface-cli download deepseek-ai/DeepSeek-R1 --exclude *.safetensors --local-dir /app/model/DeepSeek-R1
87-
RUN huggingface-cli download deepseek-ai/DeepSeek-V3-0324 --exclude *.safetensors --local-dir /app/model/DeepSeek-V3-0324
88-
RUN huggingface-cli download deepseek-ai/DeepSeek-V2-Lite-Chat --exclude *.safetensors --local-dir /app/model/DeepSeek-V2-Lite-Chat
54+
# RUN pip install huggingface_hub modelscope
55+
# RUN huggingface-cli download deepseek-ai/DeepSeek-R1 --exclude *.safetensors --local-dir /app/model/DeepSeek-R1
56+
# RUN huggingface-cli download deepseek-ai/DeepSeek-V3-0324 --exclude *.safetensors --local-dir /app/model/DeepSeek-V3-0324
57+
# RUN huggingface-cli download deepseek-ai/DeepSeek-V2-Lite-Chat --exclude *.safetensors --local-dir /app/model/DeepSeek-V2-Lite-Chat
8958

9059
# 保持容器运行(调试用)
9160
ENTRYPOINT ["tail", "-f", "/dev/null"]

0 commit comments

Comments
 (0)