From c526dada61d813931bd6791b2aa3e9bf640f8c34 Mon Sep 17 00:00:00 2001 From: Sergei Pashkevich <65038584+iBombit@users.noreply.github.com> Date: Wed, 16 Jul 2025 22:03:58 +0300 Subject: [PATCH 1/2] fixed pptr issue when running not from root user --- Dockerfile | 4 ++++ docker/v12.7.1/Dockerfile | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index eda16220..983f998a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,3 +14,7 @@ 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 \ No newline at end of file diff --git a/docker/v12.7.1/Dockerfile b/docker/v12.7.1/Dockerfile index eda16220..983f998a 100644 --- a/docker/v12.7.1/Dockerfile +++ b/docker/v12.7.1/Dockerfile @@ -14,3 +14,7 @@ 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 \ No newline at end of file From 71ccc66143a520d5b6096896e96508ad7e3a7423 Mon Sep 17 00:00:00 2001 From: Sergei Pashkevich <65038584+iBombit@users.noreply.github.com> Date: Wed, 16 Jul 2025 22:14:48 +0300 Subject: [PATCH 2/2] updated README.md --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 169ef300..12827ddd 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ - `--influxpassword`: InfluxV1 specific. Sets the InfluxDB password. Usage: `--influxpassword=YOUR_PASSWORD` - `--influxdatabase`: InfluxV1 specific. Sets the InfluxDB database. Usage: `--influxdatabase=YOUR_DATABASE` - `--configFile`: Specifies a custom Lighthouse configuration file. Usage: `--configFile=path/to/config.json` - +- `--includetimestamp`: Adds timestamp to report file names. By default is false. Usage: `--includetimestamp=true` --- ### Custom configuration file: @@ -58,10 +58,18 @@ npm install npx mocha --timeout 10000 .\test\huge.test.steps.js --browsertype=desktop --headless=false --url="https://demoqa.com/" ``` -**With docker** +**With docker (from root 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" 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/" ``` + +**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/" +```