chore: Added node and playwright installation steps in Dockerfile#282
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds Node.js 20.x and Playwright installation to the GitHub Actions runner Docker image to enable browser-based testing capabilities.
Key Changes:
- Added Node.js 20.x installation using NodeSource repository
- Installed Playwright globally with browser binaries
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | ||
| && apt-get install -y nodejs |
There was a problem hiding this comment.
The curl command pipes directly to bash without verification. Consider adding checksum verification or using a specific version hash to ensure the integrity of the installation script before execution.
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | |
| && apt-get install -y nodejs | |
| RUN apt-get update && apt-get install -y gnupg dirmngr \ | |
| && cd /tmp \ | |
| && curl -fsSLO https://deb.nodesource.com/setup_20.x \ | |
| && curl -fsSLO https://deb.nodesource.com/setup_20.x.asc \ | |
| && export GNUPGHOME="$(mktemp -d)" \ | |
| && gpg --keyserver keyserver.ubuntu.com --recv-keys 1655A0AB68576280 \ | |
| && gpg --verify setup_20.x.asc setup_20.x \ | |
| && bash setup_20.x \ | |
| && apt-get install -y nodejs \ | |
| && rm -rf "$GNUPGHOME" /tmp/setup_20.x /tmp/setup_20.x.asc |
| && apt-get install -y nodejs | ||
|
|
||
| # Install global Playwright CLI and pre-download required browser binaries | ||
| RUN npm install -g playwright && npx playwright install --with-deps |
There was a problem hiding this comment.
Installing Playwright without specifying a version may lead to inconsistent builds. Consider pinning to a specific version (e.g., 'playwright@1.40.0') to ensure reproducible builds and avoid unexpected breaking changes.
| RUN npm install -g playwright && npx playwright install --with-deps | |
| RUN npm install -g playwright@1.40.0 && npx playwright install --with-deps |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | ||
| && apt-get install -y nodejs | ||
|
|
||
| # Install global Playwright CLI and pre-download required browser binaries | ||
| RUN npm install -g playwright && npx playwright install --with-deps |
There was a problem hiding this comment.
Multiple RUN commands increase Docker layer size and build time. Consider combining these into a single RUN command with apt-get clean and removal of package lists to reduce the final image size.
Make sure that the following steps are done before merging: