- Frontend container nginx listens on 3001 instead of 80 to avoid conflicts with the host-level reverse proxy - Removed certbot service, volumes, and SSL config from docker-compose.prod.yml — SSL/certbot is managed at the host level - Updated nginx/production.conf: HTTP-only (host handles TLS), upstream frontend points to port 3001 - Updated nginx/ssl.conf frontend upstream to 3001 for consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
509 B
Docker
23 lines
509 B
Docker
# ---- Production Dockerfile for React frontend ----
|
|
# Multi-stage build: compile to static assets, serve with nginx
|
|
|
|
# Stage 1: Build
|
|
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve with nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copy the built static files
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Copy a small nginx config for SPA routing
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 3001
|
|
CMD ["nginx", "-g", "daemon off;"]
|