Files
Control-Center/frontend/Dockerfile
rex-bot 745994182f
All checks were successful
Dev Build / build-test (pull_request) Successful in 2m10s
CUB-20: Develop agent card component with dynamic status/progress
2026-04-29 11:02:33 -04:00

38 lines
1008 B
Docker

# ============================================================
# Control Center Frontend — Multi-stage Docker Build
# Angular 21 + nginx for static serving + API proxy
# ============================================================
# --- Build Stage ---
FROM node:22-slim AS builder
WORKDIR /app
# Install dependencies first (layer caching)
COPY package.json package-lock.json ./
RUN npm ci
# Copy source and build production bundle
COPY . .
RUN npm run build
# --- Runtime Stage ---
FROM nginx:1.27-alpine AS runtime
# Remove default nginx config
RUN rm /etc/nginx/conf.d/default.conf
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built Angular app from builder stage
COPY --from=builder /app/dist/frontend/browser /usr/share/nginx/html
# Expose HTTP port
EXPOSE 80
# Health check — confirm nginx is serving
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost/ || exit 1
CMD ["nginx", "-g", "daemon off;"]