Przeglądaj źródła

build(Dockerfile): 调整安装顺序以优化构建流程

将 torch 包的安装移到其他依赖安装之前,避免可能的依赖冲突并优化构建缓存的使用
DengPeng 2 tygodni temu
rodzic
commit
ee6c985a57
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      Dockerfile.backend

+ 4 - 1
Dockerfile.backend

@@ -29,11 +29,14 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
 COPY pyproject.toml README.md ./
 
 COPY apps/ ./apps/
+
 COPY main.py ./
 
+RUN pip install --no-cache-dir --break-system-packages torch==2.8.0 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
+
 RUN pip install .
 
-RUN pip install --no-cache-dir --break-system-packages torch==2.8.0 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
+
 
 RUN mkdir -p /opt/maxkb-app/model/base /opt/maxkb-app/tmp /opt/maxkb-app/logs