green
August 31, 2022, 8:54am
1
Itβs working locally, but with fly.io I get an error.
DockerFile
FROM zenika/alpine-chrome:with-node
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD 1
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH='/usr/bin/chromium-browser'
WORKDIR /usr/src/app
COPY --chown=chrome package.json package-lock.json ./
RUN npm install
COPY --chown=chrome . ./
ENTRYPOINT ["tini", "--"]
CMD ["node", "main.mjs"]
2022-08-31T08:51:01.292 app[1a284686] nrt [info] node:internal/process/esm_loader:91
2022-08-31T08:51:01.292 app[1a284686] nrt [info] internalBinding('errors').triggerUncaughtException(
2022-08-31T08:51:01.292 app[1a284686] nrt [info] ^
2022-08-31T08:51:01.292 app[1a284686] nrt [info] browserType.launch: Executable doesn't exist at /app/.cache/ms-playwright/chromium-901522/chrome-linux/chrome
2022-08-31T08:51:01.292 app[1a284686] nrt [info] βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2022-08-31T08:51:01.292 app[1a284686] nrt [info] β Looks like Playwright Test or Playwright was just installed or updated. β
2022-08-31T08:51:01.292 app[1a284686] nrt [info] β Please run the following command to download new browsers: β
2022-08-31T08:51:01.292 app[1a284686] nrt [info] β β
2022-08-31T08:51:01.292 app[1a284686] nrt [info] β npx playwright install β
2022-08-31T08:51:01.292 app[1a284686] nrt [info] β β
2022-08-31T08:51:01.292 app[1a284686] nrt [info] β <3 Playwright Team β
2022-08-31T08:51:01.292 app[1a284686] nrt [info] βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2022-08-31T08:51:01.292 app[1a284686] nrt [info] at file:///workspace/main.mjs:30:32 {
2022-08-31T08:51:01.292 app[1a284686] nrt [info] name: 'Error'
2022-08-31T08:51:01.292 app[1a284686] nrt [info] }
lubien
August 31, 2022, 1:57pm
2
green:
Playwright
Hi!
I recall some people tried to setup it here, maybe this helps:
There are some mildly tricky flags & such that need to be fiddled with, to run puppeteer/chromium in docker.
Weβve had good success with the buildkite/puppeteer docker base image, which takes care of that for you. Hereβs the entire contents of our Dockerfile, running on Fly:
FROM buildkite/puppeteer:latest
RUN mkdir /app
WORKDIR /app
COPY package.json yarn.lock /app/
RUN yarn install --frozen-lockfile
COPY ./ /app/
ENV PORT 8000
EXPOSE 8000
CMD yarn start
(Just notice it looks like theyβveβ¦
green
September 3, 2022, 8:59am
3
I used this as a reference and it worked fine.
Thank you.
FROM zenika/alpine-chrome:with-playwright
USER root
ENV NODE_ENV=production
WORKDIR /src
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD ["node" , "main.mjs"]
3 Likes
Hey @green , Iβm also trying to deploy a small app that uses playwright.
I tried using the Dockerfile you posted above, but didnβt have any luck. Did you have to do anything else to get playwright working?
Here is the Dockerfile (unchanged except for the CMD) and fly.toml I am using:
FROM zenika/alpine-chrome:with-playwright
USER root
ENV NODE_ENV=production
WORKDIR /src
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD ["node" , "server.js"]
# fly.toml file generated for spring-water-3752 on 2022-09-16T11:10:48-04:00
app = "spring-water-3752"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
dockerfile = "Dockerfile"
[env]
PORT = "8080"
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
1 Like
green
September 22, 2022, 2:13pm
5
I have changed LaunchOptions besides that
const browser = await chromium.launch({
executablePath: "/usr/bin/chromium-browser",
args: [
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
'--no-sandbox'
],
chromiumSandbox: false
});
1 Like
Jag
January 23, 2026, 9:01am
6
Iβve tried all these. I get a different problem. Playwright times out when I navigate to my first page: βTimeout 30000ms, navigating to xxxx, waiting for loadβ.
Has anyone seen this?