With React ⇒ /app/build With React + Vite ⇒ /app/dist
“ I had the same issue when using react and vite, i was referencing the /app/build but vite builds file into dist not build folder. The error i was getting ”
COPY --from=builder /app/build /usr/share/nginx/html
Link check ISSUE 11667 ⇒ HERE
Code causing the error
`FROM node:20-alpine AS builder
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html`
How i resolved it Corrected code
`FROM node:20-alpine AS builder
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html`
Note the difference in the nginx section the correct path is app/dist and not /app/build