From 34bfb649d9c6594d6db75d8ccf2f6f188c276e48 Mon Sep 17 00:00:00 2001 From: Amirhesam Adibinia Date: Mon, 4 Dec 2023 11:45:24 +0330 Subject: [PATCH] chore(frontend): make Dockerfile multistage (#53) --- frontend/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f1f086f..ad7ac2e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18.18.0 +FROM node:18.18.0 AS build WORKDIR /run @@ -6,4 +6,10 @@ COPY package*.json . RUN npm install COPY . . -CMD npm run build \ No newline at end of file +RUN npm run build + +FROM alpine:3.17.6 AS production + +WORKDIR /run +COPY --from=build /run/dist /dist +CMD cp -r /dist /run/dist