How can I run puppeteer on Fly.io

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 stopped maintaining the image, though, so it might be time to find a similar base image.)

1 Like