chore: downgrade alpine version to 3.19 to avoid issue
This commit is contained in:
parent
57ebaf6ad3
commit
e6df595af8
12
Dockerfile
12
Dockerfile
@ -8,7 +8,8 @@ RUN apt update
|
||||
RUN cd reporter && go build .
|
||||
|
||||
# Base ------------------------------
|
||||
FROM node:20-alpine AS base
|
||||
# The current Chromium version in Alpine 3.20 is causing timeout issues with Puppeteer. Downgrading to Alpine 3.19 fixes the issue. See #11640, #12637, #12189
|
||||
FROM node:20-alpine3.19 AS base
|
||||
|
||||
RUN npm install -g pnpm@9.7.1
|
||||
RUN apk add --update --no-cache python3 py3-pip g++ make
|
||||
@ -38,9 +39,12 @@ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||
ENV DEBUG=puppeteer:*
|
||||
|
||||
RUN apk add --no-cache \
|
||||
udev \
|
||||
ttf-freefont \
|
||||
chromium
|
||||
chromium \
|
||||
nss \
|
||||
freetype \
|
||||
harfbuzz \
|
||||
ca-certificates \
|
||||
ttf-freefont
|
||||
|
||||
COPY . .
|
||||
|
||||
|
@ -8,10 +8,9 @@ export async function generateLighthouse(url: string): Promise<Result> {
|
||||
const browser = await puppeteer.launch({
|
||||
// Set to false if you want to see the script in action.
|
||||
headless: 'new',
|
||||
args: ['--no-sandbox', '--single-process'],
|
||||
args: ['--no-sandbox', '--single-process', '--disable-dev-shm-usage'],
|
||||
defaultViewport: null,
|
||||
ignoreDefaultArgs: ['--enable-automation'],
|
||||
dumpio: true,
|
||||
});
|
||||
|
||||
try {
|
||||
@ -31,11 +30,13 @@ export async function generateLighthouse(url: string): Promise<Result> {
|
||||
throw new Error('Lighthouse failed to generate report');
|
||||
}
|
||||
|
||||
page.close({ runBeforeUnload: false });
|
||||
await page.close({ runBeforeUnload: false });
|
||||
|
||||
const { lhr } = res;
|
||||
|
||||
return lhr;
|
||||
} catch (err) {
|
||||
throw err;
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user