add puppeteer executable path

This commit is contained in:
OxSaitama 2023-09-30 22:19:01 +02:00
parent f4d3319d51
commit 95606f3e5f
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,9 @@
# Install dependencies only when needed
FROM node:19-alpine AS deps
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
WORKDIR leCoffre
RUN npm install -D prisma@4.11.0
@ -33,9 +36,6 @@ FROM node:19-alpine AS production
WORKDIR leCoffre
ENV CHROME_BIN="/usr/bin/chromium-browser"\
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
COPY --from=builder --chown=lecoffreuser leCoffre/node_modules ./node_modules

View File

@ -73,7 +73,7 @@ export default class AnchoringProofService extends BaseService {
public async generate(data: AnchoringProofData): Promise<Buffer> {
const browser = await puppeteer.launch({
headless: "new",
executablePath: process.env['CHROME_BIN'],
executablePath: process.env['PUPPETEER_EXECUTABLE_PATH'],
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
const page = await browser.newPage();