All checks were successful
Deploy / deploy (push) Successful in 12s
nginx:alpine is a minimal image that does not include wget. Install curl explicitly and use curl -f for the healthcheck. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
736 B
Docker
22 lines
736 B
Docker
# ── 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
|
|
|
|
RUN apk add --no-cache curl
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD curl -f http://localhost/ || exit 1
|