When I tried to navigate, i found that, no page was available
I tried to deploy react webpage in Choreo (powered by WSO2) using the docker file. The website is working. But I am not able to navigate to the pages. For instance, when I tried to navigate to the page URL/dashboard, the page comes saying "404 not found". When I checked the runtime error, i saw this below message " failed (2: No such file or directory) "
This was the dockerfile
FROM node:16-alpine as builder
RUN npm install -g pnpm
# WORKDIR /
WORKDIR /app
COPY . .
RUN if [ -f "./package-lock.json" ]; then npm install; \
elif [ -f "./yarn.lock" ]; then yarn; \
elif [ -f "./pnpm-lock.yaml" ]; then pnpm install;fi
COPY . .
RUN npm run build
FROM nginxinc/nginx-unprivileged:stable-alpine-slim
# Update nginx user/group in alpine
ENV ENABLE_PERMISSIONS=TRUE
ENV DEBUG_PERMISSIONS=TRUE
ENV USER_NGINX=10015
ENV GROUP_NGINX=10015
# COPY --from=builder /build /usr/share/nginx/html/
COPY --from=builder /app/build /usr/share/nginx/html/
# COPY nginx.conf /usr/local/etc/nginx
COPY nginx.conf /usr/share/nginx
USER 10015
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
This was the nginx.conf
server {
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}
}
Can someone help me with this?