From 4c4e3310daa5bf1601fda8afa9621c17f9e87610 Mon Sep 17 00:00:00 2001 From: Sergey Nikitin Date: Sat, 20 Jan 2024 19:31:35 +0100 Subject: [PATCH] multi --- Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 258f0977..d79b35b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,6 @@ FROM node:20.11.0 AS builder ENV NODE_ENV production -USER root - ARG APP_DIR=/usr/src/app/ RUN mkdir -p "$APP_DIR" @@ -20,8 +18,6 @@ FROM node:20.11.0 EXPOSE 8080 -USER node - ENV NEW_RELIC_NO_CONFIG_FILE true ENV NODE_ENV production @@ -31,15 +27,17 @@ ENV APP_VERSION ${APP_VERSION} RUN echo ${APP_VERSION} -ARG APP_DIR=/usr/src/app/ +# ARG APP_DIR=/usr/src/app/ +# +# RUN mkdir -p "$APP_DIR" +# WORKDIR $APP_DIR +# +# COPY --from=builder $APP_DIR/package.json $APP_DIR +# COPY --from=builder $APP_DIR/package-lock.json $APP_DIR +# RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force +# +# COPY --from=builder $APP_DIR/dist $APP_DIR/dist -RUN mkdir -p "$APP_DIR" -WORKDIR $APP_DIR - -COPY --from=builder $APP_DIR/package.json $APP_DIR -COPY --from=builder $APP_DIR/package-lock.json $APP_DIR -RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force - -COPY --from=builder $APP_DIR/dist $APP_DIR/dist +USER node CMD ["npm", "run", "cluster:js"]