Skip to content

femtopixel/docker-google-lighthouse-puppeteer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caution

As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support my work.

Note

(This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.)

logo

Google Lighthouse Puppeteer - Docker Image

latest 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)