From 5d6290e6b6f186bf538dd489bd0cb4d769a8ce76 Mon Sep 17 00:00:00 2001 From: hardik Date: Wed, 6 Aug 2025 13:11:35 +0530 Subject: [PATCH] updated docker file for html --- Dockerfile | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3562df41..31f9f4fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,14 @@ +# Use lightweight Nginx image +FROM nginx:alpine -FROM node:21-alpine as builder +# Remove default nginx static files +RUN rm -rf /usr/share/nginx/html/* -ARG API_BASE_URL="https://www.sangwaritaxi.com/" +# Copy your HTML/CSS/JS files into nginx's web root +COPY . /usr/share/nginx/html -ENV REACT_APP_API_BASE_URL $API_BASE_URL +# Expose port 80 for the web server +EXPOSE 80 -WORKDIR /app - -COPY package.json package.json -COPY yarn.lock yarn.lock - -RUN yarn install --frozen-lockfile - -COPY . . - -RUN yarn build - - -FROM scratch - -WORKDIR /app - -COPY --from=builder /app/build ./build - -CMD ["sh"] -# new +# Start nginx +CMD ["nginx", "-g", "daemon off;"]