Dokku is an alternative for Heroku, with a self hosted version.
I try to use Puppeteer Chrome headless with this code:
const browser = await puppeteer.launch({
headless: true,
args: [
'--no-sandbox',
'--disable-setuid-sandbox'
]
});
const page = await browser.newPage();
When Dokku build and launch the app, I get this error:
Error: Failed to launch chrome! /app/node_modules/puppeteer/.local-chromium/linux-641577/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
The troubleshooting page say to install packages. But Dokku haven't access to this installed package because he working with Docker.
Also, I've installed buildpack with this command:
dokku buildpacks:add <app_name> jontewks/puppeteer
or this git repository
dokku buildpacks:add <app_name> https://github.com/jontewks/puppeteer-heroku-buildpack.git
I execute the deploy command again dokku deploy <app_name>
and I've always errors in logs.