修复部署依赖下载缓慢和解析失败,启用镜像源及构建缓存
This commit is contained in:
+6
-1
@@ -3,7 +3,12 @@ FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||
# 国内服务器从默认PyPI下载大型识别组件可能超时;可用构建参数覆盖源。
|
||||
ARG PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
python -m pip install --disable-pip-version-check --retries 3 --timeout 120 \
|
||||
--index-url "${PIP_INDEX_URL}" -r /app/requirements.txt
|
||||
RUN python -c "import PIL, rapidocr, onnxruntime, cv2"
|
||||
|
||||
COPY server /app/server
|
||||
COPY duty /app/duty
|
||||
|
||||
Reference in New Issue
Block a user