fix(preview service): set userDataDir and update list of dependencies for chrome (#2400)

* fix(preview service): update list of dependencies for chrome
- https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-doesnt-launch-on-linux

* Set user data directory for puppeteer to be read-write volume in k8s
This commit is contained in:
Iain Sproat 2024-06-19 11:12:32 +01:00 коммит произвёл GitHub
Родитель 4dea8249d5
Коммит c85761c636
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 39 добавлений и 30 удалений

Просмотреть файл

@ -38,40 +38,48 @@ RUN yarn workspaces foreach -W run build
FROM node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 as node
# cache bust
RUN echo 1
#hadolint ignore=DL3008
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
tini=0.19.0-1 \
# chromium dependencies \
ca-certificates=20230311 \
fonts-liberation=1:1.07.4-11 \
libasound2=1.2.8-1+b1 \
libatk-bridge2.0-0=2.46.0-5 \
libatk1.0-0=2.46.0-5 \
libatspi2.0-0=2.46.0-5 \
libcairo2=1.16.0-7 \
libcups2=2.4.2-3+deb12u5 \
libdbus-1-3=1.14.10-1~deb12u1 \
libdrm2=2.4.114-1+b1 \
libexpat1=2.5.0-1 \
libgbm1=22.3.6-1+deb12u1 \
libglib2.0-0=2.74.6-2 \
libnspr4=2:4.35-1 \
libnss3=2:3.87.1-1 \
libpango-1.0-0=1.50.12+ds-1 \
libx11-6=2:1.8.4-2+deb12u2 \
libxcb1=1.15-1 \
libxcomposite1=1:0.4.5-1 \
libxdamage1=1:1.1.6-1 \
libxext6=2:1.3.4-1+b1 \
libxfixes3=1:6.0.0-2 \
libxkbcommon0=1.5.0-1 \
libxrandr2=2:1.5.2-2+b1 \
wget=1.21.3-1+b2 \
xdg-utils=1.1.3-4.1 \
chromium=126.0.6478.56-1~deb12u1 \
# chromium dependencies
ca-certificates \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libc6 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libexpat1 \
libfontconfig1 \
libgbm1 \
libgcc1 \
libglib2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libstdc++6 \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
lsb-release \
wget \
xdg-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Просмотреть файл

@ -60,6 +60,7 @@ async function pageFunction(objectUrl) {
async function getScreenshot(objectUrl, boundLogger = logger) {
const launchParams = {
headless: shouldBeHeadless,
userDataDir: '/tmp/puppeteer',
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage']
}
// if ( process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD === 'true' ) {