From b95434d19edcbf72a2a5cfb9422ddf439c8b7e6a Mon Sep 17 00:00:00 2001 From: Ahn Jiwan Date: Thu, 28 Dec 2023 19:20:54 +0900 Subject: [PATCH] :ambulance: hotfix: configure dockerfile for typescript compile (#6) --- Dockerfile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3c18b2..c6a91a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,20 @@ -FROM node:18 - +FROM node:18 as builder + WORKDIR /app - + COPY package*.json ./ - + RUN npm install - + COPY . . - -EXPOSE 80 + +RUN tsc + +FROM node:18 + +WORKDIR /app + +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/dist ./dist CMD ["npm", "start"]