...is a huge pain. After hours of searching through every possible snippet on the Internet I coulld find, this is the Dockerfile that finally worked for me. Let it bring you joy.
Note: This approach doesn't create a special previledged user, so you have to add
--no-sandbox
to the Puppeteer's browserargs
.
{
"puppeteer": "^23.1.0"
}
import { launch } from 'puppeteer'
const browser = await launch({
headless: true,
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-gpu',
'--disable-software-rasterizer',
],
})