fix(docker): Pre-install Playwright Chromium browsers for automated t…#745
fix(docker): Pre-install Playwright Chromium browsers for automated t…#745
Conversation
…esting Fixes #725 AI agents in automated testing mode require Playwright to verify implementations, but Docker containers had only system dependencies installed, not browser binaries. This caused verification failures with permissions errors. Changes: - Install Playwright Chromium in Dockerfile (~300MB increase) - Update docker-compose.override.yml.example with clearer Playwright documentation - Add "Playwright for Automated Testing" section to README - Document optional volume mount for persisting browsers across rebuilds Browsers are now pre-installed and work out of the box for Docker users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughPre-installs Playwright Chromium in the Docker server image, updates README with Playwright E2E testing and cache guidance, and clarifies docker-compose.override.yml.example with an optional Playwright browser cache volume and manual update instructions. Changes
Sequence Diagram(s)(omitted — changes are build and documentation focused and do not introduce a new multi-component runtime flow) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses issue #725 by pre-installing Playwright Chromium in the Docker image, enabling automated testing without requiring additional setup. It also includes documentation updates and configuration examples to guide users on how to persist the browser cache across container rebuilds. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request pre-installs Playwright Chromium browsers in the Docker image to enable automated testing out of the box. The changes include updating the Dockerfile to install the browser, and modifying the README and docker-compose example file to document this feature and the optional persistence of the browser cache. My review focuses on improving the Docker layer caching and clarifying the documentation around using a persistent volume for the Playwright cache to avoid user confusion.
- Clean up npx cache after Playwright installation to reduce image size - Clarify README: volume mounts persist cache across container lifecycles, not image rebuilds - Add first-use warning: empty volume overrides pre-installed browsers, users must re-install with docker exec command 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@docker-compose.override.yml.example`:
- Around line 24-30: Update the manual Playwright update instruction so it runs
inside the automaker-server container as the automaker user with working
directory /app (so Playwright installs to /home/automaker/.cache/ms-playwright
instead of root); specifically replace the current example command that runs as
root with one that executes the install command in the automaker-server
container using user "automaker" and working directory "/app".
In `@Dockerfile`:
- Around line 122-126: The Playwright install RUN (the command "npx playwright
install chromium") must be moved so it runs after the COPY --from=server-builder
/app/node_modules ./node_modules step; update the Dockerfile to remove the early
RUN and add a new RUN after the node_modules copy that invokes the locally
installed playwright (e.g., use ./node_modules/.bin/playwright install chromium
or npx --no-install playwright install chromium) so the pinned version from
node_modules/package-lock.json is used and no registry fetch occurs.
In `@README.md`:
- Line 347: Replace the bold subsection title "**Optional: Persist browsers
across container rebuilds**" with a proper Markdown heading (e.g., "###
Optional: Persist browsers across container rebuilds" or another appropriate
heading level) so it stops being flagged by markdownlint MD036; locate the exact
bold text in README.md and change it to the chosen heading syntax.
- Around line 362-366: Update the README's manual browser update command so it
runs as the automaker user and from /app: change the documented docker exec
invocation that currently runs npx playwright install chromium in the container
(automaker-server) to include running as user "automaker" and setting the
working directory to "/app" (i.e. add the equivalent of the docker exec flags to
set user and workdir) so that the Playwright browser cache is written to the
automaker user's cache directory rather than root.
- Move Playwright install after node_modules copy to use pinned version - Use local playwright binary instead of npx to avoid registry fetch - Add --user automaker -w /app flags to docker exec commands - Change bold text to proper heading in README (MD036 lint fix) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tested this PR - found an issue and submitted a fixI tested this PR on WSL2 Ubuntu and found that the Playwright install step fails during Docker build: Root cause: The Fix: I've submitted #751 which adds Feel free to:
Happy to help however is most useful! |
Fixes #725
AI agents in automated testing mode require Playwright to verify implementations, but Docker containers had only system dependencies installed, not browser binaries. This caused verification failures with permissions errors.
Changes:
Browsers are now pre-installed and work out of the box for Docker users.
Summary by CodeRabbit
New Features
Documentation