Skip to content

feat: 多变体 Docker 镜像(with-browser / without-browser)#122

Merged
hangone merged 2 commits into
mainfrom
feat/multi-docker-variants
May 30, 2026
Merged

feat: 多变体 Docker 镜像(with-browser / without-browser)#122
hangone merged 2 commits into
mainfrom
feat/multi-docker-variants

Conversation

@hangone

@hangone hangone commented May 30, 2026

Copy link
Copy Markdown
Owner

改动

Docker 镜像变体

  • hangyi/weban:latest / with-browser(419MB):基于 chromedp/headless-shell,内置 Chrome headless shell,开箱即用
  • hangyi/weban:without-browser(164MB):基于 debian:stable-slim,纯二进制,通过 CDP 连接宿主机浏览器

两个变体共享同一个 Dockerfile 的 builder 阶段,CI 中通过 --target 构建,GHA cache 复用。

浏览器自动检测

按优先级自动检测,无需手动配置:

  1. 用户指定(CHROMIUM_BINARY / browser_path
  2. CDP 远程调试(cdp_host + cdp_port,Docker 下自动尝试 host.docker.internal:9222
  3. Playwright 浏览器
  4. 系统浏览器

CI 变更

  • 原 4 个 Docker job 合并为 1 个 matrix job(variant × platform
  • Tag:latest / with-browser / <版本号> → 内置浏览器,without-browser / <版本号>-without-browser → 轻量镜像

文件变更

文件 说明
Dockerfile 多 target:with-browser(chromedp/headless-shell)+ without-browser(debian:stable-slim)
.github/workflows/build.yml 合并为单 matrix job,共享 builder cache
README.md Docker 变体说明 + 浏览器检测优先级文档
captcha.py 拆分 _find_playwright_browser()check_browser_health() 实现完整优先级链
main.py Docker 环境自动检测 + CDP 默认地址回退

Copilot AI review requested due to automatic review settings May 30, 2026 15:23
@hangone hangone merged commit d6aedec into main May 30, 2026
1 of 2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants