fix: Nginx Fix
This commit is contained in:
parent
965a63c5ff
commit
b352a73190
30
Dockerfile
30
Dockerfile
|
|
@ -1,31 +1,23 @@
|
|||
# ---------- Build stage ----------
|
||||
# ---------- Build stage (Keep this the same) ----------
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Build React app
|
||||
RUN npm run build
|
||||
|
||||
# ---------- Production stage ----------
|
||||
FROM nginx:alpine
|
||||
# ---------- Diagnostic Production stage ----------
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Remove default nginx config
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
# Set the working directory to where the React files live
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
# Copy custom nginx config
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# Copy build output from the build stage
|
||||
COPY --from=build /app/dist .
|
||||
|
||||
# Copy build output
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
# Expose standard nginx port
|
||||
# Expose port 80 (Cloud Run expects this)
|
||||
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"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue