Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ This parameter allows you to pass a custom JSON file to override the default Lig
2. Verify that headless mode is enabled via the `--headless=true` flag.
3. In the repository directory, run the following command:
```bash
docker run --rm -v "$PWD:$PWD" -w "$PWD" --user "$(id -u):$(id -g)" ibombit/lighthouse-puppeteer-chrome:12.8.1-alpine npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=true --url="https://demoqa.com/"
docker run --rm -v "$PWD:$PWD" -w "$PWD" --user "$(id -u):$(id -g)" ibombit/lighthouse-puppeteer-chrome:12.8.2-alpine npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=true --url="https://demoqa.com/"
```
20 changes: 20 additions & 0 deletions docker/v12.8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Run w/ Puppeteer w/ Lighthouse in a container
#
# Lighthouse is a tool that allows auditing, performance metrics, and best
# practices for Progressive Web Apps.
#
# Puppeteer-core doesn't have a browser
# so having executablePath in LH browser settings in mandatory

FROM node:alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci --production

FROM alpine:latest
RUN apk add --no-cache nodejs npm chromium
COPY --from=build /app .
# Set environment variables for Chromium to avoid issues with Puppeteer
# See: https://github.com/puppeteer/puppeteer/issues/11023#issuecomment-1776247197
ENV XDG_CONFIG_HOME=/tmp/.chromium
ENV XDG_CACHE_HOME=/tmp/.chromium
Loading