I've switched the base image from node:22 to node:22-alpine to reduce image size.
Key changes include:
- Updated FROM instruction to node:22-alpine.
- Replaced apt-get with apk for package management.
- Updated package names to their Alpine equivalents (e.g., libasound2 to alsa-lib, libgtk-4-1 to gtk+3.0).
- Modified Chrome and Chromedriver installation to use Alpine's `chromium` and `chromium-chromedriver` packages instead of manual downloads.
- Ensured correct user, working directory permissions, and order of operations, particularly for directory creation and ownership before switching to the 'node' user.
Note: The Docker image build process encountered an environmental 'no space left on device' error. Therefore, I could not complete full build verification and subsequent functional testing of the image. The Dockerfile changes are based on best practices for Alpine conversion.