How to set up Puppeteer for AWS Lambda using Docker?

My TypeScript PDF generator with Puppeteer works locally but fails on AWS Lambda Docker deployment due to missing shared libraries. See the examples below:

const browserHandle = await require('puppeteer').launch({
  headless: true,
  args: ['--no-sandbox', '--disable-gpu'],
  executablePath: '/usr/bin/chromium'
});
const pageHandle = await browserHandle.newPage();
FROM public.ecr.aws/lambda/nodejs:14
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run compile
CMD ["dist/index.js"]

hey, im having similar probs; i fixed mine by installing missing libs via apt-get (like libgtk) in the dockerfile. also, double-checking chromium binary’s path helped alot. give it a go.