-
Notifications
You must be signed in to change notification settings - Fork 491
chore(docker): add Playwright Chromium prerequisites #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(docker): add Playwright Chromium prerequisites #478
Conversation
|
Important Review skippedToo many files! 15 files out of 165 files are above the max files limit of 150. You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThe pull request adds Playwright/Chromium system dependencies to Docker configuration files (Dockerfile, Dockerfile.dev) and includes commented example volume guidance in docker-compose.override.yml.example for optional Playwright cache persistence. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 @thesobercoder, 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 enhances the Docker images by integrating necessary system dependencies for Playwright and Chromium, resolving potential runtime issues in slim Debian environments. Additionally, it provides a documented method for users to persist Playwright browser installations, which will significantly reduce setup time and bandwidth for end-to-end testing and browser automation workflows. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly adds the necessary system dependencies for Playwright/Chromium to the Docker images and provides a helpful example for caching downloaded browsers. My review includes suggestions to improve the maintainability of the Dockerfiles by sorting the long list of new packages. I've also identified and suggested a fix for an indentation issue in the docker-compose.override.yml.example file that would cause errors for users who uncomment the new volume definition. Overall, these are good changes that improve the development and testing experience.
docker-compose.override.yml.example
Outdated
| # Playwright cache volume (persists Chromium installs) | ||
| # playwright-cache: | ||
| # name: automaker-playwright-cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of this commented-out volume definition is incorrect. If a user uncomments these lines as-is, it will result in a YAML syntax error. Top-level keys in docker-compose.yml files (like volumes) should have their direct children indented by two spaces.
# Playwright cache volume (persists Chromium installs)
# playwright-cache:
# name: automaker-playwright-cache
| libglib2.0-0 libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 \ | ||
| libcups2 libdrm2 libxkbcommon0 libatspi2.0-0 libxcomposite1 libxdamage1 \ | ||
| libxfixes3 libxrandr2 libgbm1 libasound2 libpango-1.0-0 libcairo2 \ | ||
| libx11-6 libx11-xcb1 libxcb1 libxext6 libxrender1 libxss1 libxtst6 \ | ||
| libxshmfence1 libgtk-3-0 libexpat1 libfontconfig1 fonts-liberation \ | ||
| xdg-utils libpangocairo-1.0-0 libpangoft2-1.0-0 libu2f-udev libvulkan1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better readability and maintainability, it's good practice to sort package lists alphabetically. This makes it easier to see what's included and to spot duplicates or missing packages in the future.
fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 \
libcups2 libdbus-1-3 libdrm2 libexpat1 libfontconfig1 libgbm1 \
libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
libpangoft2-1.0-0 libu2f-udev libvulkan1 libx11-6 libx11-xcb1 libxcb1 \
libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 \
libxrender1 libxshmfence1 libxss1 libxtst6 xdg-utils \
| libglib2.0-0 libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 \ | ||
| libcups2 libdrm2 libxkbcommon0 libatspi2.0-0 libxcomposite1 libxdamage1 \ | ||
| libxfixes3 libxrandr2 libgbm1 libasound2 libpango-1.0-0 libcairo2 \ | ||
| libx11-6 libx11-xcb1 libxcb1 libxext6 libxrender1 libxss1 libxtst6 \ | ||
| libxshmfence1 libgtk-3-0 libexpat1 libfontconfig1 fonts-liberation \ | ||
| xdg-utils libpangocairo-1.0-0 libpangoft2-1.0-0 libu2f-udev libvulkan1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better readability and maintainability, it's good practice to sort this package list alphabetically.
Additionally, this list of dependencies is now duplicated between Dockerfile and Dockerfile.dev. To avoid them getting out of sync in the future, you might consider extracting this list into a shared script in the scripts/ directory as part of a future refactoring.
fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 \
libcups2 libdbus-1-3 libdrm2 libexpat1 libfontconfig1 libgbm1 \
libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
libpangoft2-1.0-0 libu2f-udev libvulkan1 libx11-6 libx11-xcb1 libxcb1 \
libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 \
libxrender1 libxshmfence1 libxss1 libxtst6 xdg-utils \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@docker-compose.override.yml.example`:
- Around line 34-37: The top-level volumes block has excessive indentation for
the commented volume definition; un-indent the commented lines so they align
under the top-level "volumes:" key with two spaces (i.e., adjust
"playwright-cache:" and "name: automaker-playwright-cache" to the same
indentation level as other top-level entries) so users can safely uncomment
without YAML indentation errors.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
DockerfileDockerfile.devdocker-compose.override.yml.example
🔇 Additional comments (3)
Dockerfile.dev (1)
11-21: LGTM! Playwright dependencies are well-documented.The system library list correctly covers Playwright/Chromium runtime requirements for Debian-slim images. The inline comment clarifies the purpose, aiding future maintainability.
docker-compose.override.yml.example (1)
19-21: LGTM! Helpful documentation for Playwright cache persistence.The commented example clearly explains the volume mount purpose and usage workflow. This provides good guidance without forcing configuration on users.
Dockerfile (1)
63-72: LGTM! Dependencies align with Dockerfile.dev.The package list correctly mirrors Dockerfile.dev, ensuring consistency across development and production images. The inline comment clarifies the purpose.
Consider whether Playwright dependencies are needed in the production image. If browser automation is only used during development/testing, these libraries (~40-60MB) could be omitted from the production stage to reduce image size. However, if runtime browser automation (e.g., scraping, PDF generation) is a production feature, keeping them is appropriate.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
- Add missing system libraries required by Playwright/Chromium in server and dev images\n- Document optional Playwright browser cache volume in docker-compose.override.yml.example
7f9ca26 to
5e330b7
Compare
This PR adds missing Debian system libraries required for Playwright/Chromium to run inside the Automaker Docker images, and documents an optional cache volume for persisting downloaded Playwright browsers.
Changes:
Why:
E2E tests (and any browser automation) rely on Playwright + Chromium. Without these system libraries, Chromium can fail to launch in slim Debian images.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.