From f39168266ff87ddfea08c350bfc52764ccc8ea54 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov <zimniy@cyberbrain.pw> Date: Wed, 18 Dec 2024 19:52:32 +0400 Subject: [PATCH] refactor: typo & app dir Signed-off-by: Dmitriy Safronov <zimniy@cyberbrain.pw> --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d9f590..e14886c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,21 @@ # --------------> The builder image FROM node:20.13.1 AS builder ENV NODE_ENV=production -WORKDIR /usr/src/app +WORKDIR /home/node/app RUN apt-get update && apt-get install -y --no-install-recommends dumb-init ARG NPM_TOKEN -COPY package*.json /usr/src/app/ +COPY package*.json ./ RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && \ - npm install -g npm@$10.8.0 && \ + npm install -g npm@10.8.0 && \ npm ci --omit=dev && \ rm -f .npmrc # --------------> The production image FROM node:20.13.1-slim AS production ENV NODE_ENV=production -WORKDIR /usr/src/app +WORKDIR /home/node/app COPY --from=builder /usr/bin/dumb-init /usr/bin/dumb-init -COPY --chown=node:node --from=builder /usr/src/app/node_modules /usr/src/app/node_modules -COPY --chown=node:node . /usr/src/app +COPY --chown=node:node --from=builder /home/node/app/node_modules ./node_modules +COPY --chown=node:node . ./ USER node CMD ["dumb-init", "node", "index.js"] -- GitLab