From 5d378693315e12b3cb30a98988e53461e15855fc Mon Sep 17 00:00:00 2001 From: mukesh13 Date: Mon, 23 Jun 2025 19:35:50 +0530 Subject: [PATCH] Docker update --- Dockerfile | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 75bb319..d5ec799 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,17 @@ -# syntax=docker/dockerfile:1.4 - # Build stage -FROM node:18-alpine AS build +FROM node:18 AS build WORKDIR /app -# Update package database and install build dependencies -RUN apk update && apk add --no-cache python3 make g++ py3-pip - -# Copy package files -COPY package.json package-lock.json ./ - -# Install dependencies +COPY package*.json ./ RUN npm install --legacy-peer-deps -# Copy source code COPY . . - -# Build the Gatsby app RUN npm run build # Production stage -FROM nginx:alpine AS production +FROM nginx:alpine -# Copy nginx config -RUN echo 'server { listen 80; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf - -# Copy built files COPY --from=build /app/public /usr/share/nginx/html -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +EXPOSE 80 \ No newline at end of file