From 1f4a6600434773b86bee53f5a0d990a588531863 Mon Sep 17 00:00:00 2001 From: Kalidou Diagne Date: Wed, 30 Oct 2024 19:06:34 +0100 Subject: [PATCH 1/2] docker update --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c907e39d..27a837fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,18 @@ FROM node:18-alpine3.18 as builder RUN apk add --no-cache git curl WORKDIR /builder + +COPY package.json yarn.lock ./ +RUN npm i -g yarn && yarn install + COPY . . -RUN npm i -g yarn -RUN yarn install RUN yarn build + + # Create image by copying build artifacts FROM node:18-alpine3.18 as runner -RUN npm i -g yarn +RUN rm -rf /usr/local/bin/yarn && npm i -g yarn --force USER node ARG PORT=3000 From 18755175146de2387ba3a0b81d392a71ec4ab382 Mon Sep 17 00:00:00 2001 From: Kalidou Diagne Date: Wed, 30 Oct 2024 19:08:11 +0100 Subject: [PATCH 2/2] update docker config --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27a837fc..9f6bb72d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,17 +9,14 @@ RUN npm i -g yarn && yarn install COPY . . RUN yarn build - - # Create image by copying build artifacts FROM node:18-alpine3.18 as runner -RUN rm -rf /usr/local/bin/yarn && npm i -g yarn --force USER node -ARG PORT=3000 WORKDIR /home/node COPY --chown=node:node --from=builder /builder/ ./ +ARG PORT=3000 EXPOSE ${PORT} CMD ["yarn", "start"]