From 73d4385f8110199a7c6f843dbcd9cc63dddb5ae9 Mon Sep 17 00:00:00 2001 From: Victor Klomp Date: Mon, 28 Oct 2024 10:44:41 +0100 Subject: [PATCH] fix(docker): reduce size by about half --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 501508e96..4f87cf692 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ RUN npm install COPY ./ ./ RUN npm run build \ && npm run swagger +RUN npm ci --production # The target image that will be run FROM node:18-alpine as target @@ -13,8 +14,7 @@ FROM node:18-alpine as target RUN apk add openssl WORKDIR /app -COPY ./package.json ./package-lock.json ./ -RUN npm ci +COPY --from=build --chown=node /app/node_modules /app/node_modules RUN npm install pm2 pm2-graceful-intercom -g RUN npm install -g typeorm ARG TYPEORM_USERNAME