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"