From b5db3706a98f4d9da2710032ac0eaee73421d9ac Mon Sep 17 00:00:00 2001 From: Dmitry Neverovski Date: Tue, 12 Mar 2024 00:40:35 +0100 Subject: [PATCH] chore: update Dockerfile --- Dockerfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 089d5f9..b6137f2 100755 --- a/Dockerfile +++ b/Dockerfile @@ -14,16 +14,16 @@ USER node FROM node:20-alpine3.17 AS build LABEL author="Dmitry Neverovski " +WORKDIR /app + ARG NODE_ENV ENV NODE_ENV=${NODE_ENV:-development} -WORKDIR /app - COPY --chown=node:node package*.json ./ COPY --chown=node:node --from=deps /app/node_modules ./node_modules COPY --chown=node:node . . -RUN NODE_ENV=${NODE_ENV} npm run build +RUN NODE_ENV=${NODE_ENV} npm run build:api USER node @@ -31,11 +31,11 @@ USER node FROM node:20-alpine3.17 AS modules LABEL author="Dmitry Neverovski " +WORKDIR /app + ARG NODE_ENV ENV NODE_ENV=${NODE_ENV:-development} -WORKDIR /app - COPY --chown=node:node package*.json ./ RUN npm ci --omit=dev --ignore-scripts @@ -49,14 +49,10 @@ LABEL author="Dmitry Neverovski " ARG APP_PORT ENV APP_PORT=${APP_PORT:-5656} -WORKDIR /app -USER node - COPY --chown=node:node package*.json ./ +COPY --chown=node:node templates ./templates COPY --chown=node:node --from=modules /app/node_modules ./node_modules COPY --chown=node:node --from=build /app/dist ./dist -COPY --chown=node:node swagger ./swagger -COPY --chown=node:node templates ./templates EXPOSE ${APP_PORT}