From e0e41117dbabcdf4f0d9563f0e37899680fda0b5 Mon Sep 17 00:00:00 2001 From: Minsu Kim Date: Fri, 27 Dec 2024 18:51:47 +0700 Subject: [PATCH] =?UTF-8?q?:ambulance:=20hotfix:=20alpine=EC=97=90?= =?UTF-8?q?=EC=84=9C=20openssl,=20prisma=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 18 +++++++++++------- package.json | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 445235d..4efa695 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,20 @@ -FROM node:20-alpine +FROM node:22-alpine3.19 AS base WORKDIR /usr/src/app +COPY . . -COPY package.json ./ -COPY yarn.lock ./ +FROM base AS prod-deps +RUN apk add --no-cache git +RUN yarn install --prod --frozen-lockfile +FROM base AS build RUN apk add --no-cache git RUN yarn install --frozen-lockfile - -COPY . . - RUN yarn build +FROM base +COPY --from=prod-deps /usr/src/app/node_modules /usr/src/app/node_modules +COPY --from=build /usr/src/app/dist /usr/src/app/dist + EXPOSE 3000 -CMD [ "node", "dist/main.js" ] \ No newline at end of file +CMD [ "node", "dist/main.js" ] diff --git a/package.json b/package.json index 9fdf23b..0c9d97f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "private": true, "license": "UNLICENSED", "scripts": { - "build": "prisma generate & nest build", + "build": "prisma generate && nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch",