add browser dependencies
This commit is contained in:
parent
6ab4c9c44b
commit
ad799f3367
27
Dockerfile
27
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
# Install dependencies only when needed
|
# Install dependencies only when needed
|
||||||
FROM node:19-alpine AS deps
|
FROM node:18-bullseye-slim AS deps
|
||||||
|
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
||||||
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
|
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
|
||||||
@ -9,7 +9,15 @@ 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 chromium
|
#RUN apk update && apk add openssh-client git chromium
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y wget gnupg \
|
||||||
|
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
||||||
|
&& 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 -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 openssh-client git \
|
||||||
|
--no-install-recommends \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
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
|
||||||
@ -19,7 +27,7 @@ RUN ssh-keyscan github.com smart-chain-fr/leCoffre-resources.git >> /root/.ssh/k
|
|||||||
RUN npm install --frozen-lockfile
|
RUN npm install --frozen-lockfile
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
# Rebuild the source code only when needed
|
||||||
FROM node:19-alpine AS builder
|
FROM node:18-bullseye-slim AS builder
|
||||||
|
|
||||||
WORKDIR leCoffre
|
WORKDIR leCoffre
|
||||||
|
|
||||||
@ -33,14 +41,15 @@ RUN npx prisma generate
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM node:19-alpine AS production
|
FROM node:18-bullseye-slim AS production
|
||||||
|
|
||||||
WORKDIR leCoffre
|
WORKDIR leCoffre
|
||||||
|
|
||||||
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser . \
|
RUN adduser --disabled-password lecoffreuser --uid 10000 && chown -R lecoffreuser .
|
||||||
&& mkdir -p /home/lecoffreuser/Downloads /app \
|
|
||||||
&& chown -R lecoffreuser:lecoffreuser /home/lecoffreuser \
|
RUN mkdir -p /home/lecoffreuser/Downloads \
|
||||||
&& chown -R lecoffreuser:lecoffreuser /app
|
&& mkdir -p /home/lecoffreuser/Downloads \
|
||||||
|
&& chown -R lecoffreuser:lecoffreuser /home/lecoffreuser
|
||||||
|
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre/node_modules ./node_modules
|
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
|
||||||
@ -51,3 +60,5 @@ USER lecoffreuser
|
|||||||
|
|
||||||
CMD ["npm", "run", "start"]
|
CMD ["npm", "run", "start"]
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user