From 09de9a2b42cd133be00817b80d59feb2c35a305c Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 21 Mar 2024 12:24:40 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8B=20fix(Dockerfile):=20add=20back=20?= =?UTF-8?q?additional=20deps.,=20handle=20permissions,=20use=20`--no-audit?= =?UTF-8?q?`=20flag=20on=20install=20(#2157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c53f40919..a63791a68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,23 @@ # Base node image FROM node:18-alpine AS node -COPY . /app +RUN mkdir -p /app && chown node:node /app WORKDIR /app +USER node + +COPY --chown=node:node . . + # Allow mounting of these files, which have no default # values. RUN touch .env RUN npm config set fetch-retry-maxtimeout 300000 +RUN apk add g++ make py3-pip +RUN npm install -g node-gyp + RUN apk --no-cache add curl && \ - npm install + npm install --no-audit # React client build ENV NODE_OPTIONS="--max-old-space-size=2048"