Update Error Nginx Refresh page

This commit is contained in:
ahmadafriadi 2025-06-30 13:41:44 +07:00
parent ba28cf49a0
commit 19fd1b5542
2 changed files with 4 additions and 3 deletions

View File

@ -1,12 +1,13 @@
# Build stage # Build React
FROM node:18 AS build FROM node:18 AS build
WORKDIR /app WORKDIR /app
COPY . . COPY . .
RUN npm install --legacy-peer-deps RUN npm install --legacy-peer-deps
RUN npm run build RUN npm run build
# Serve stage # Serve with Nginx
FROM nginx:alpine FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

View File

@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc -b && vite build --base=/",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {