Skip to content

Commit 65a389c

Browse files
committed
docker: don't pin playwright, split: system deps + firefox after npm install
`npx playwright install --with-deps firefox` fails since package.json references 1.29 but current version is 1.30: `browserType.launchPersistentContext: Executable doesn't exist at /root/.cache/ms-playwright/firefox-1369/firefox/firefox` Need to either pin the version there or install the browser after `npm install` which will make it take into account the package.json version. See microsoft/playwright#13188, microsoft/playwright#12835 Image size: 1. 1.12GB - `npx playwright install --with-deps firefox` -> fails due to wrong browser version 2. 1.12GB - `npx [email protected] install --with-deps firefox` -> pinning version works, but need to also update Dockerfile when updating package.json 3. 920MB - `npx playwright install-deps firefox` -> fails, system deps only, no browser 4. 1.12GB - 3. + `npx install firefox` after `npm install` -> works, no pinning needed, system deps stuff is cleaned up with the rest of the apt installs; breaks if system deps change...
1 parent b9e9abe commit 65a389c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN apt-get update \
2323
novnc websockify \
2424
dos2unix \
2525
python3-pip \
26-
&& npx playwright@1.29 install --with-deps firefox \
26+
&& npx playwright install-deps firefox \
2727
&& apt-get clean \
2828
&& rm -rf \
2929
/tmp/* \
@@ -38,7 +38,8 @@ RUN pip install apprise
3838
WORKDIR /fgc
3939
COPY package*.json ./
4040

41-
RUN npm install
41+
# If firefox is installed (~/.cache/ms-playwright/firefox-*) before `npm install` it may be a newer version than in package.json and playwright will not find it; system deps are installed sep. via apt above to avoid having to pin the version there.
42+
RUN npm install && npx playwright install firefox
4243

4344
COPY . .
4445

0 commit comments

Comments
 (0)