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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --head
2. Verify that headless mode is enabled via "--headless=true" flag
3. In repo dir run this command:
```
docker run --rm -v "$PWD:$PWD" -w "$PWD" ibombit/lighthouse-puppeteer-chrome:12.7.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" ibombit/lighthouse-puppeteer-chrome:12.8.0-alpine npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=true --url="https://demoqa.com/"
```

**With docker (from current user)**
1. git clone https://github.com/iBombit/lighthouse_custom
2. Verify that headless mode is enabled via "--headless=true" flag
3. In repo dir run this command:
```
docker run --rm -v "$PWD:$PWD" -w "$PWD" --user "$(id -u):$(id -g)" ibombit/lighthouse-puppeteer-chrome:12.7.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.0-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.0/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