From c22b5fba75172ab4fce4ba05651868bed8ab80f1 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Fri, 13 Sep 2024 16:29:07 +0200 Subject: [PATCH] . --- Dockerfile.server | 32 ++++++++++--------- .../reporter/ReportQuote.reporter.ts | 1 + 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Dockerfile.server b/Dockerfile.server index 7c466ff..3222d7a 100644 --- a/Dockerfile.server +++ b/Dockerfile.server @@ -3,21 +3,6 @@ # 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 libnss3 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 @@ -48,6 +33,23 @@ COPY server/src/contexts/sales/infrastructure/express/controllers/quotes/reportQ # FINAL STAGE (Producción) FROM node:lts-iron AS prod +# 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 libnss3 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/* + +RUN apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 libcairo2 libpango-1.0-0 + WORKDIR /api # Copiar los archivos del build desde la fase anterior diff --git a/server/src/contexts/sales/infrastructure/express/controllers/quotes/reportQuote/reporter/ReportQuote.reporter.ts b/server/src/contexts/sales/infrastructure/express/controllers/quotes/reportQuote/reporter/ReportQuote.reporter.ts index 09a04e4..77cc175 100644 --- a/server/src/contexts/sales/infrastructure/express/controllers/quotes/reportQuote/reporter/ReportQuote.reporter.ts +++ b/server/src/contexts/sales/infrastructure/express/controllers/quotes/reportQuote/reporter/ReportQuote.reporter.ts @@ -34,6 +34,7 @@ export const ReportQuotePresenter: IReportQuoteReporter = { // Generar el PDF con Puppeteer const browser = await puppeteer.launch({ args: [ + "--disable-extensions", "--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage",