From be4fa40fe776306be3bfd5c80440462c84a2d1ee Mon Sep 17 00:00:00 2001 From: Mohamed Gallah Date: Thu, 4 Jan 2024 23:06:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BBUpdate=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 14 ++++++-------- yarn.lock | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ded70e..6f3be16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,13 @@ -# Step 1: Build the application -FROM node:latest as build-stage +# Build Stage +FROM node:18-alpine AS build-stage WORKDIR /app COPY package.json yarn.lock ./ RUN yarn install COPY . . RUN yarn build -# Step 2: Serve the application using a static server -FROM node:latest as serve-stage -WORKDIR /app -COPY --from=build-stage /app/dist /app -RUN yarn global add serve +# Production Stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html EXPOSE 8001 -CMD ["serve", "-s", ".", "-l", "8001"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/yarn.lock b/yarn.lock index 8662ce8..40b885c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -879,9 +879,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001399, caniuse-lite@^1.0.30001400: - version "1.0.30001402" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001402.tgz#aa29e1f47f5055b0d0c07696a67b8b08023d14c8" - integrity sha512-Mx4MlhXO5NwuvXGgVb+hg65HZ+bhUYsz8QtDGDo2QmaJS2GBX47Xfi2koL86lc8K+l+htXeTEB/Aeqvezoo6Ew== + version "1.0.30001574" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001574.tgz" + integrity sha512-BtYEK4r/iHt/txm81KBudCUcTy7t+s9emrIaHqjYurQ10x71zJ5VQ9x1dYPcz/b+pKSp4y/v1xSI67A+LzpNyg== chalk@^2.0.0, chalk@^2.4.1: version "2.4.2"