fix: Nginx Fix

This commit is contained in:
Danny 2026-01-09 12:09:54 -06:00
parent 965a63c5ff
commit b352a73190
1 changed files with 11 additions and 19 deletions

View File

@ -1,31 +1,23 @@
# ---------- Build stage ---------- # ---------- Build stage (Keep this the same) ----------
FROM node:20-alpine AS build FROM node:20-alpine AS build
WORKDIR /app WORKDIR /app
# Install dependencies
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci RUN npm ci
# Copy source
COPY . . COPY . .
# Build React app
RUN npm run build RUN npm run build
# ---------- Production stage ---------- # ---------- Diagnostic Production stage ----------
FROM nginx:alpine FROM python:3.11-slim
# Remove default nginx config # Set the working directory to where the React files live
RUN rm /etc/nginx/conf.d/default.conf WORKDIR /usr/share/nginx/html
# Copy custom nginx config # Copy build output from the build stage
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/dist .
# Copy build output # Expose port 80 (Cloud Run expects this)
COPY --from=build /app/dist /usr/share/nginx/html
# Expose standard nginx port
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] # Run Python's built-in simple HTTP server
# This server is very "dumb" and will ignore/accept large IAP headers
CMD ["python", "-m", "http.server", "80"]