updated docker file for html
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
hardik 2025-08-06 13:11:35 +05:30
parent 1567719aac
commit 5d6290e6b6
1 changed files with 10 additions and 23 deletions

View File

@ -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 # Start nginx
CMD ["nginx", "-g", "daemon off;"]
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