chore(docker): 预装 Playwright MCP/CLI 及 chromium

镜像内全局预装 @playwright/mcp、@playwright/cli、playwright,并
`playwright install --with-deps chromium` 预置浏览器及系统依赖,运行时
不再联网下载。browser MCP 启动参数去掉 -y 与 @latest(改用已装好的本地版本)。

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
Autumn-27andClaude Opus 4.8 committed 2026-07-28 11:52:53 -04:00
1 parent abc551cc76
commit 3f798ec74e
2 files changed
+10 -1

No files matched your search

+9
View File
@@ -18,6 +18,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
nodejs npm \
dnsutils iputils-ping netcat-openbsd whois nmap \
&& rm -rf /var/lib/apt/lists/*
# 预装 Playwright MCP 与 CLI(全局),运行时不再 npx 联网下载。
# @playwright/mcp:browser MCP 直接 `npx @playwright/mcp`(已全局装好,无需 -y/@latest)。
# @playwright/cli:提供 playwright-cli,装完顺带 --help 验证可执行。
# 再装 playwright(提供浏览器管理),装完用 --with-deps 预置 chromium 及其系统依赖,
# 这样容器内 MCP/CLI 首次启动即可用,不再联网下载浏览器。
RUN npm install -g @playwright/mcp@latest @playwright/cli@latest playwright@latest \
&& playwright-cli --help \
&& playwright install --with-deps chromium \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 预编译好的对应架构二进制(dist/amd64/artex 或 dist/arm64/artex)
COPY dist/${TARGETARCH}/artex /app/artex
+1 -1
View File
@@ -184,7 +184,7 @@ ON CONFLICT (agent_id, var_name) DO UPDATE
INSERT INTO mcp_servers(name, transport, command, args, env, enabled)
VALUES ('browser', 'stdio', 'npx', $1, '{}', false)
ON CONFLICT (name) DO NOTHING`,
`["-y","@playwright/mcp@latest","--headless"]`); err != nil {
`["@playwright/mcp","--headless"]`); err != nil {
return fmt.Errorf("seed browser mcp: %w", err)
}
// NOTE: the placeholder ScopeSentry data-source MCP (empty URL + empty X-API-Key,