This commit is contained in:
@@ -59,13 +59,12 @@ ENV DEBUG=false
|
||||
# 安装依赖
|
||||
# =============================================================================
|
||||
# 复制本地模型文件到镜像(如果有)
|
||||
COPY docker/models/*.whl /tmp/models/ 2>/dev/null || true
|
||||
# 注意:docker/models/ 目录需要在构建上下文中存在
|
||||
COPY docker/models/ /tmp/models/
|
||||
|
||||
# 安装本地模型 wheel(如果有)
|
||||
RUN if [ -n "$(ls -A /tmp/models/ 2>/dev/null)" ]; then \
|
||||
pip install --no-cache-dir /tmp/models/*.whl && \
|
||||
rm -rf /tmp/models; \
|
||||
fi
|
||||
# 安装本地模型 wheel(如果有 .whl 文件)
|
||||
RUN find /tmp/models -name "*.whl" -type f 2>/dev/null | head -1 | xargs -r pip install --no-cache-dir && \
|
||||
rm -rf /tmp/models
|
||||
|
||||
# 设置 pip 国内镜像源
|
||||
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
Reference in New Issue
Block a user