forked from admin/VolcanicAgenticCore
feat(docker): optional Playwright MCP and Chromium in the image
INSTALL_PLAYWRIGHT=true installs @playwright/mcp@0.0.82 globally and runs its own playwright dependency's installer (install --with-deps chromium) into /opt/ms-playwright, readable by all users. The build fails if playwright-mcp --version does not run.
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -52,7 +52,18 @@ RUN npm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" \
|
||||
|
||||
# Set even without Playwright, so an MCP server started with the host environment finds browsers here.
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright
|
||||
# INSTALL_PLAYWRIGHT block (T2)
|
||||
# Playwright MCP at the pinned version, and Chromium installed by that package's own playwright dependency, so browser
|
||||
# build and library version match. Roughly +400 MB.
|
||||
RUN if [ "$INSTALL_PLAYWRIGHT" = "true" ]; then \
|
||||
npm install -g "@playwright/mcp@${PLAYWRIGHT_MCP_VERSION}" \
|
||||
&& pw="$(npm root -g)/@playwright/mcp/node_modules/playwright/cli.js" \
|
||||
&& test -f "$pw" \
|
||||
&& node "$pw" install --with-deps chromium \
|
||||
&& chmod -R a+rX "$PLAYWRIGHT_BROWSERS_PATH" \
|
||||
&& playwright-mcp --version \
|
||||
&& npm cache clean --force \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# The entrypoint hard-codes uid/gid 1654. Named volumes copy this ownership on first mount.
|
||||
RUN test "$(id -u app)" = 1654 && test "$(id -g app)" = 1654 \
|
||||
|
||||
Reference in New Issue
Block a user