🐋 fix(Dockerfile): add back additional deps., handle permissions, use --no-audit flag on install (#2157)

This commit is contained in:
Danny Avila 2024-03-21 12:24:40 -04:00 committed by GitHub
parent a673f62831
commit 09de9a2b42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,16 +1,23 @@
# Base node image # Base node image
FROM node:18-alpine AS node FROM node:18-alpine AS node
COPY . /app RUN mkdir -p /app && chown node:node /app
WORKDIR /app WORKDIR /app
USER node
COPY --chown=node:node . .
# Allow mounting of these files, which have no default # Allow mounting of these files, which have no default
# values. # values.
RUN touch .env RUN touch .env
RUN npm config set fetch-retry-maxtimeout 300000 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 && \ RUN apk --no-cache add curl && \
npm install npm install --no-audit
# React client build # React client build
ENV NODE_OPTIONS="--max-old-space-size=2048" ENV NODE_OPTIONS="--max-old-space-size=2048"