This commit is contained in:
David Arranz 2024-09-13 13:58:41 +02:00
parent 83df3a87fe
commit 10f48bb0e6
2 changed files with 21 additions and 1 deletions

View File

@ -3,6 +3,21 @@
# BUILD STAGE
FROM node:lts-iron AS builder
# Configure default locale (important for chrome-headless-shell).
ENV LANG es_ES.UTF-8
# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Establecer el directorio de trabajo
WORKDIR /api

View File

@ -33,7 +33,12 @@ export const ReportQuotePresenter: IReportQuoteReporter = {
// Generar el PDF con Puppeteer
const browser = await puppeteer.launch({
args: ["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage"],
args: [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
"--disable-gpu",
],
});
const page = await browser.newPage();