Added nginx for compile into proxy setup

This commit is contained in:
2026-10-02 13:56:10 -07:00
parent b8aa67f64c
commit 1c2044801e
2 changed files with 46 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# Stage 1: The Node Builder
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci
# Copy React source code and build it
COPY . .
RUN npm run build
# Stage 2: The Nginx Server
FROM nginx:alpine
# Copy the compiled files from Stage 1 (Change /dist to /build if using Create-React-App instead of Vite)
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy your custom Nginx routing file
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]