add chromium for puppeteer

This commit is contained in:
OxSaitama 2023-10-05 18:15:51 +02:00
parent 5cb4159022
commit 1b1ece3e2d
2 changed files with 6 additions and 14 deletions

View File

@ -1,9 +0,0 @@
const {join} = require('path');
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
// Changes the cache location for Puppeteer.
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};

View File

@ -1,14 +1,15 @@
# Install dependencies only when needed # Install dependencies only when needed
FROM node:19-alpine AS deps FROM node:19-alpine AS deps
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
WORKDIR leCoffre WORKDIR leCoffre
RUN npm install -D prisma@4.11.0 RUN npm install -D prisma@4.11.0
COPY package.json ./ COPY package.json ./
RUN apk update && apk add openssh-client git RUN apk update && apk add openssh-client git chromium
# ENV PUPPETEER_CACHE_DIR=~/leCoffre/.cache/puppeteer
# ENV PUPPETEER_SKIP_DOWNLOAD=false
COPY id_rsa /root/.ssh/id_rsa COPY id_rsa /root/.ssh/id_rsa
RUN chmod 600 ~/.ssh/id_rsa RUN chmod 600 ~/.ssh/id_rsa
@ -24,7 +25,7 @@ WORKDIR leCoffre
COPY --from=deps leCoffre/node_modules ./node_modules COPY --from=deps leCoffre/node_modules ./node_modules
COPY --from=deps leCoffre/package.json package.json COPY --from=deps leCoffre/package.json package.json
#COPY --from=deps leCoffre/.cache ./.cache COPY --from=deps leCoffre/.cache ./.cache
COPY tsconfig.json tsconfig.json COPY tsconfig.json tsconfig.json
COPY src src COPY src src
@ -43,7 +44,7 @@ COPY --from=builder --chown=lecoffreuser leCoffre/node_modules ./node_modules
COPY --from=builder --chown=lecoffreuser leCoffre/dist dist COPY --from=builder --chown=lecoffreuser leCoffre/dist dist
COPY --from=builder --chown=lecoffreuser leCoffre/package.json ./package.json COPY --from=builder --chown=lecoffreuser leCoffre/package.json ./package.json
COPY --from=builder --chown=lecoffreuser leCoffre/src/common/databases ./src/common/databases COPY --from=builder --chown=lecoffreuser leCoffre/src/common/databases ./src/common/databases
#COPY --from=builder --chown=lecoffreuser leCoffre/.cache ./.cache COPY --from=builder --chown=lecoffreuser leCoffre/.cache ./.cache
USER lecoffreuser USER lecoffreuser