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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# Puppeteer-core doesn't have a browser
# so having executablePath in LH browser settings in mandatory

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

FROM alpine:3.21
FROM alpine:3.23
RUN apk add --no-cache nodejs npm chromium && \
rm -rf /var/cache/apk/*
COPY --from=build /app .
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ This parameter allows you to pass a custom JSON file to override the default Lig
"--disable-gpu-sandbox",
"--display",
"--ignore-certificate-errors",
"--disable-storage-reset=true"
"--disable-storage-reset=true",
"--disable-features=LocalNetworkAccessChecks"
],
"headful": [
"--allow-no-sandbox-job",
"--allow-sandbox-debugging",
"--no-sandbox",
"--ignore-certificate-errors",
"--disable-storage-reset=true"
"--disable-storage-reset=true",
"--disable-features=LocalNetworkAccessChecks"
]
}
}
Expand Down Expand Up @@ -127,7 +129,7 @@ Common browser arguments include:
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" ibombit/lighthouse-puppeteer-chrome:13.0.3-alpine npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=true --url="https://demoqa.com/" --configFile=customConfig.json
docker run --rm -v "$PWD:$PWD" -w "$PWD" ibombit/lighthouse-puppeteer-chrome:13.1.0-alpine npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=true --url="https://demoqa.com/" --configFile=customConfig.json
```

### From Current User:
Expand All @@ -139,5 +141,5 @@ Common browser arguments include:
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:13.0.3-alpine npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=true --url="https://demoqa.com/" --configFile=customConfig.json
docker run --rm -v "$PWD:$PWD" -w "$PWD" --user "$(id -u):$(id -g)" ibombit/lighthouse-puppeteer-chrome:13.1.0-alpine npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=true --url="https://demoqa.com/" --configFile=customConfig.json
```
6 changes: 4 additions & 2 deletions customConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
"--disable-gpu-sandbox",
"--display",
"--ignore-certificate-errors",
"--disable-storage-reset=true"
"--disable-storage-reset=true",
"--disable-features=LocalNetworkAccessChecks"
],
"headful": [
"--allow-no-sandbox-job",
"--allow-sandbox-debugging",
"--no-sandbox",
"--ignore-certificate-errors",
"--disable-storage-reset=true"
"--disable-storage-reset=true",
"--disable-features=LocalNetworkAccessChecks"
]
}
}
Expand Down
21 changes: 21 additions & 0 deletions docker/v13.1.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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:alpine3.23 AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci --production

FROM alpine:3.23
RUN apk add --no-cache nodejs npm chromium && \
rm -rf /var/cache/apk/*
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
Loading