From c1f1c1a3d74d85531b2241d607953d905719e6a3 Mon Sep 17 00:00:00 2001 From: Ommanimesh2 <93693087+Ommanimesh2@users.noreply.github.com> Date: Sat, 17 Feb 2024 12:30:04 +0530 Subject: [PATCH] bfix: Updates production dockerfile --- Dockerfile | 27 ++++++++++++++------------- docker-compose.yaml | 2 -- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index b871830..3912417 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,21 @@ -FROM node:latest as build +FROM node:18-alpine -WORKDIR /app +WORKDIR /app -COPY package.json package-lock.json ./ +# Copy package.json and package-lock.json +COPY package*.json / -RUN npm install +# Install dependencies +RUN npm ci -COPY . ./ +# Copy the rest of the code +COPY . . -RUN npm run build +# Build the app +RUN npm run build +# Expose the port the app runs on +EXPOSE 3000 -FROM nginx:alpine - -COPY --from=build /app/build /usr/share/nginx/html - -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] +# Start the application +CMD ["npm", "run","start"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index c6b91e0..abf8957 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,5 +11,3 @@ services: - "8081:3000" volumes: - .:/app - stdin_open: true - tty: true