Skip to content

Commit a269384

Browse files
committed
docs(docker): install the browser with the project Playwright, not vpx
The GitLab and derived-image examples used `vpx playwright install`, which downloads the latest Playwright and can fetch a browser revision different from the project lockfile, missing the baked cache at test time. Use `vp exec playwright install` after `vp install` so the browser matches the version the tests resolve. Addresses Codex review feedback.
1 parent 8cb1ffd commit a269384

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

docs/guide/docker.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,26 @@ test:
151151
image: ghcr.io/voidzero-dev/vite-plus:latest
152152
script:
153153
- vp install --frozen-lockfile
154-
- vpx playwright install --with-deps chromium
154+
- vp exec playwright install --with-deps chromium
155155
- vp test
156156
```
157157

158+
`vp exec` runs the project's own Playwright (from your lockfile), so it installs
159+
the browser revision your tests expect. Prefer it over `vpx playwright install`,
160+
which would download whatever Playwright is latest and can fetch a different
161+
browser revision.
162+
158163
To bake the browser and its libraries into a derived image instead of installing
159-
them on every run, do it in a build stage (root is available through `sudo`):
164+
them on every run, install the project dependencies first so the baked browser
165+
matches your lockfile, then install with the project's Playwright (root is
166+
available through `sudo`):
160167

161168
```dockerfile [Dockerfile]
162169
FROM ghcr.io/voidzero-dev/vite-plus:latest
163-
RUN vpx playwright install --with-deps chromium
170+
WORKDIR /app
171+
COPY --chown=vp:vp package.json pnpm-lock.yaml pnpm-workspace.yaml .node-version* ./
172+
RUN vp install --frozen-lockfile
173+
RUN vp exec playwright install --with-deps chromium
164174
```
165175

166176
If Chromium crashes under load in CI, give the container more shared memory with

0 commit comments

Comments
 (0)