mirror of
https://github.com/furyhawk/agent_alpha.git
synced 2026-07-21 02:25:34 +00:00
29 lines
1.1 KiB
Docker
29 lines
1.1 KiB
Docker
# ──────────────────────────────────────────────────────────────────
|
|
# Frontend — React + Vite build, served via nginx
|
|
# ──────────────────────────────────────────────────────────────────
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first (layer caching)
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci
|
|
|
|
# Copy source and build
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# ── Runtime stage — nginx ─────────────────────────────────────────
|
|
FROM nginx:alpine
|
|
|
|
# Copy our custom nginx config
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Copy built assets from builder stage
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
|
CMD wget -qO- http://localhost:80/ || exit 1
|