Skip to content

Commit 67e622e

Browse files
committed
docker: move firefox install up to other apt deps; --with-deps needed!
Without --with-deps we get and error starting the browser: node:internal/process/esm_loader:108 internalBinding('errors').triggerUncaughtException( ^ browserType.launchPersistentContext: ╔══════════════════════════════════════════════════════╗ ║ Host system is missing dependencies to run browsers. ║ ║ Please install them with the following command: ║ ║ ║ ║ npx playwright install-deps ║ ║ ║ ║ Alternatively, use apt: ║ ║ apt-get install libgtk-3-0\ ║ ║ libasound2\ ║ ║ libxcomposite1\ ║ ║ libpangocairo-1.0-0\ ║ ║ libpango-1.0-0\ ║ ║ libatk1.0-0\ ║ ║ libcairo-gobject2\ ║ ║ libcairo2\ ║ ║ libgdk-pixbuf-2.0-0\ ║ ║ libdbus-glib-1-2\ ║ ║ libxcursor1 ║ ║ ║ ║ <3 Playwright Team ║ ╚══════════════════════════════════════════════════════╝ at async file:///fgc/prime-gaming.js:25:17 { name: 'Error' }
1 parent 8ce6c2f commit 67e622e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
# Partially from https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.focal
33
FROM ubuntu:jammy
44

5+
# Configuration variables are at the end!
6+
57
# https://github.com/hadolint/hadolint/wiki/DL4006
68
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
79
ARG DEBIAN_FRONTEND=noninteractive
810
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD true
911

10-
# Install up-to-date node & npm, then deps for virtual screen & noVNC
12+
# Install up-to-date node & npm, deps for virtual screen & noVNC, browser.
13+
# Playwright needs --with-deps for firefox.
1114
RUN apt-get update \
1215
&& apt-get install -y curl \
1316
&& curl -fsSL https://deb.nodesource.com/setup_19.x | bash - \
@@ -19,6 +22,7 @@ RUN apt-get update \
1922
tini \
2023
novnc websockify \
2124
dos2unix \
25+
&& npx playwright install --with-deps firefox \
2226
&& apt-get clean \
2327
&& rm -rf \
2428
/tmp/* \
@@ -32,16 +36,11 @@ RUN ln -s /usr/share/novnc/vnc_auto.html /usr/share/novnc/index.html
3236
WORKDIR /fgc
3337
COPY package*.json ./
3438

35-
# Install browser & dependencies only
36-
RUN npm install \
37-
&& npx playwright install --with-deps firefox \
38-
&& apt-get clean \
39-
&& rm -rf /var/lib/apt/lists/*
39+
RUN npm install
4040

4141
COPY . .
4242

43-
# Shell scripts
44-
# On windows, git might be configured to check out dos/CRLF line endings, so we convert them for those people in case they want to build the image.
43+
# Shell scripts need Linux line endings. On Windows, git might be configured to check out dos/CRLF line endings, so we convert them for those people in case they want to build the image.
4544
RUN dos2unix ./docker/*.sh
4645
RUN mv ./docker/entrypoint.sh /usr/local/bin/entrypoint \
4746
&& chmod +x /usr/local/bin/entrypoint

0 commit comments

Comments
 (0)