Skip to content
Run containerized lighthouse audits.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Lighthouse Runner

Run Chrome Lighthouse against your application in a docker container


Check out the examples directory to see an example docker-compose files that can be used to run a container from the image against a containerized web application. You can provide a SUT_URL environment variable to the lighthouse container to find your running application. A simple wait-for-it script will ensure that your application is responding with a 200 HTTP status code before lighthouse begins.

Given the following docker-compose you can leverage the --exit-code-from flag of docker-compose up to inherit the exit code of a specific service. Therefore if lighthouse fails then the docker-compose command fails.

 docker-compose \
      -f example/docker-compose.yml \
      up --exit-code-from "lighthouse"
version: "3.3"
    # build:
    #  context: ./../src
    #  dockerfile: Dockerfile
    # image: lighthouse-image
    # container_name: lighthouse-container
    image: <this-lighthouse-image>
    network_mode: "host"
    command: ["bash"]
      - SUT_URL=http://localhost:8000
      - VERBOSE=true
      - SILENT=false
    image: <my-application-to-test-image>
      - "8000:8000"


VERBOSE environment variable can be used to get the most logging from lighthouse audit. SILENT enviornment variable can be used to remove all logging.


Currently there is no way to configure thresholds on lighthouse categories. If your application does not meet 100% in each category then it is considered a failure.

Currently there is no way to inject desired chrome flags to be used by lighthouse as part of the configuration.

You can’t perform that action at this time.