Merge pull request 'updated docker file for html' (#2) from feature/docker into main
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: #2
This commit is contained in:
commit
6572bf4d59
33
Dockerfile
33
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;"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue