From 07b7b5b4f79edc34ec240920ebeffb90b024d16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Thu, 25 Jun 2026 17:05:15 +0800 Subject: [PATCH] =?UTF-8?q?common=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 1 + Dockerfile | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/Dockerfile b/Dockerfile index 195c954..42506c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,15 +37,19 @@ RUN apk add --no-cache py3-opencv # 预装 PySceneDetect(--no-deps: scenedetect 强依赖 opencv-python 会触发源码编译) # opencv 已由 apk 的 py3-opencv 提供,无需 pip 重复安装 -RUN pip3 install --break-system-packages --no-deps -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com scenedetect \ - && pip3 install --break-system-packages -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com click platformdirs tqdm +# pip 24+ 扫描系统包元数据时崩溃(python-4.10.0 版本号无效) +# 用虚拟环境隔离 +RUN python3 -m venv --system-site-packages /opt/venv \ + && /opt/venv/bin/pip install --no-deps -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com scenedetect \ + && /opt/venv/bin/pip install -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com click platformdirs tqdm +ENV PATH=/opt/venv/bin:$PATH # 验证 PySceneDetect 安装 RUN python3 -c "import scenedetect; print(f'scenedetect {scenedetect.__version__} installed')" # 预装 HyperFrames(全局安装) # 使用 npmmirror 镜像加速 -RUN npm install -g hyperframes --registry=https://registry.npmmirror.com/ --ignore-scripts +RUN npm install -g hyperframes --ignore-scripts # HyperFrames 渲染需要 Chromium/Chrome # 安装 Chromium(提供系统级共享库依赖)和中文字体