I was able to get this code all approved to be shared: https://gist.github.com/josiahbryan/35d753423

I was able to get this code all approved to be shared: https://gist.github.com/josiahbryan/35d7534234f2652648c10e4b13a0730e
  • in it, you'll find:
    • Dockerfile
      • the file we use to build our k8 image
    • browser-service.yml
      • How we run the docker container in our cluster
    • routes.js
      • The routes we expose (via express, not shown)
    • session-controller.js
      • How we manage sessions
    • browser-controller.js
      • How we load Puppeteer
        Also are a few other utils
mportant note:

We found that we MUST use Puppeteer 17.1.3 for our builds - I think due to compatibility with the wallaby-esm module, but not entirely sure. Here's the package versions we're using:

    "puppeteer": "^17.1.3",
    "puppeteer-extra": "^3.3.6",
    "puppeteer-extra-plugin-stealth": "^2.11.2",


Just FYI - hope some of that helps! Feel free to hit me up with quesitons.

Disclaimer: Not all code is original, some is built on examples found elsewhere online! We just stiched it all together to make it work with our benchwork and cluster and our usecases
Gist
Dockerfile/K8 Setup example for running Puppeteer. GitHub Gist: instantly share code, notes, and snippets.
Was this page helpful?