refactor: split back into two containers (backend + frontend)
Single-container supervisord approach added unnecessary complexity. Two containers is simpler and more standard: - Dockerfile.backend: python:3.11-slim, uvicorn on port 8000 - Dockerfile.frontend: node build → nginx:alpine on port 80 - nginx.conf: proxy_pass restored to http://backend:8000 - docker-compose.yml: two services with depends_on - Removed combined Dockerfile and supervisord.conf Each container does one thing; logs are separate; either can be restarted independently. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
19
flight-comparator/Dockerfile.frontend
Normal file
19
flight-comparator/Dockerfile.frontend
Normal file
@@ -0,0 +1,19 @@
|
||||
# ── Stage 1: Build React frontend ─────────────────────────────────────────
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
# ── Stage 2: Serve with nginx ──────────────────────────────────────────────
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD wget -q --spider http://localhost/ || exit 1
|
||||
Reference in New Issue
Block a user