From 8492e1582ca3d74abd83b10cb862c7c353f25383 Mon Sep 17 00:00:00 2001 From: ismoilovdevml Date: Fri, 5 Jan 2024 10:34:43 +0500 Subject: [PATCH] [OPTIMIZE] optimize docker image --- Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a42e255..a4ae353 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,19 @@ -FROM node:16 +FROM node:16-alpine AS build + WORKDIR /app COPY package*.json ./ - RUN npm install --legacy-peer-deps + COPY . . RUN npm run build + +FROM node:16-alpine + +WORKDIR /app + +COPY --from=build /app ./ + EXPOSE 3000 CMD ["npm", "start"] \ No newline at end of file