File size: 512 Bytes
de55c35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d0a19ba
de55c35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Stage 1: Build React/Vite app
FROM node:20-alpine AS build
WORKDIR /app

# Copy package files and install dependencies
COPY package*.json ./
RUN npm ci

# Copy all source files
COPY . .

# Build the production bundle
RUN npm run build

# Stage 2: Serve using Nginx
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html

# Copy the custom Nginx configuration to support SPA routing (Vite React Router)
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 7860
CMD ["nginx", "-g", "daemon off;"]