From fe6598efcd6eed77a264aae253dd86e978f404b5 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 21 Mar 2024 12:09: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?= 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 c53f4091933..a63791a68ee 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"