From b37a287c9c63b6955e454e8497a16746a2231712 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 2 Feb 2026 15:55:11 +0100 Subject: [PATCH] fix(docker): Address PR #745 review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- Dockerfile | 4 +++- README.md | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d22858c..f5c3511e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -121,9 +121,11 @@ RUN curl -fsSL https://opencode.ai/install | bash && \ # Install Playwright Chromium browser for AI agent verification tests # This adds ~300MB to the image but enables automated testing mode out of the box +# Clean up npx cache after installation to reduce image size RUN npx playwright install chromium && \ echo "=== Playwright Chromium installed ===" && \ - ls -la /home/automaker/.cache/ms-playwright/ || echo "Playwright browsers installed" + ls -la /home/automaker/.cache/ms-playwright/ || echo "Playwright browsers installed" && \ + rm -rf /home/automaker/.npm/_npx USER root # Add PATH to profile so it's available in all interactive shells (for login shells) diff --git a/README.md b/README.md index 645ba722..0c21245b 100644 --- a/README.md +++ b/README.md @@ -344,9 +344,18 @@ The Docker image includes **Playwright Chromium pre-installed** for AI agent ver **No additional setup required** - Playwright verification works out of the box. -**Optional: Persist browsers across container rebuilds** +**Optional: Persist browsers for manual updates** -To avoid re-downloading browsers when rebuilding the Docker image, add this to your `docker-compose.override.yml`: +By default, Playwright Chromium is pre-installed in the Docker image. If you need to manually update browsers or want to persist browser installations across container restarts (not image rebuilds), you can mount a volume. + +**Important:** When you first add this volume mount to an existing setup, the empty volume will override the pre-installed browsers. You must re-install them: + +```bash +# After adding the volume mount for the first time +docker exec automaker-server npx playwright install chromium +``` + +Add this to your `docker-compose.override.yml`: ```yaml services: