femtopixel/google-lighthouse-puppeteer

Sponsored OSS

By FemtoPixel

Updated 13 days ago

Google Lighthouse + Puppeteer - Docker Image

Image
Languages & frameworks
Monitoring & observability
Web analytics
4

50K+

femtopixel/google-lighthouse-puppeteer repository overview

Github Issues

Google Lighthouse Puppeteer - Docker Image

latest release NPM release Docker Pulls Docker Stars PayPal donation Buy me a coffee Buy me a coffee

  • Google Chrome Headless is the Google Chrome browser that can be started without graphical interface to accomplish several tasks (PDF printing, performance, automation...)
  • Google Lighthouse analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices.
  • Google Puppeteer is a tool to automate tasks on a Chrome (headless) browser.

Description

The purpose of this image is to produce performance report for several pages in connected mode and in an automated way to be integrated in a CI environment.

It uses lighthouse-batch to be able to automate export of multiple

Docker Usage

docker run --rm --name perf -it -v /path/to/your/report/folder:/home/chrome/reports -v /path/to/your/testcases/folder:/home/chrome/testcases --cap-add SYS_ADMIN femtopixel/google-lighthouse-puppeteer <name_of_the_test>  

with <name_of_the_test> the name of the test in the testcases folder without .js

Note: you should check https://github.com/femtopixel/google-lighthouse-puppeteer/blob/master/README.md to see how to redact your testcases.

Example
docker run --rm --name perf -it -v /path/to/your/report/folder:/home/chrome/reports -v /path/to/your/testcases/folder:/home/chrome/testcases --cap-add SYS_ADMIN femtopixel/google-lighthouse-puppeteer my_test  

Docker Usage : Improved

Using the ever-awesome Jessie Frazelle SECCOMP profile for Chrome, we don't have to use the hammer that is SYS_ADMIN:

wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json
docker run --rm --name perf -it -v /path/to/your/report/folder:/home/chrome/reports -v /path/to/your/testcases/folder:/home/chrome/testcases --security-opt seccomp=$HOME/chrome.json femtopixel/google-lighthouse-puppeteer <name_of_the_test> 

FAQ

  Runtime error encountered: { Error: EACCES: permission denied, open '/home/chrome/reports/myawesome_site_admin_heavypage.report.json'
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/home/chrome/reports/myawesome_site_admin_heavypage.report.json' }

Make sure your folder has the write right for others (chmod o+w)

Tag summary

Content type

Image

Digest

sha256:807b49fb2

Size

1003.4 MB

Last updated

13 days ago

docker pull femtopixel/google-lighthouse-puppeteer:v13.4.0-puppeteer-v25.3.0-1.5.0

This week's pulls

Pulls:

434

Last week