Kaynağa Gözat

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

将 torch 包的安装移到其他依赖安装之前,避免可能的依赖冲突并优化构建缓存的使用
DengPeng 2 hafta önce
ebeveyn
işleme
ee6c985a57
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  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