2026-02-08 18:44:05 -04:00
|
|
|
# ==============================================================================
|
|
|
|
|
# Goa GEL Frontend - Multi-stage Docker Build
|
|
|
|
|
# ==============================================================================
|
|
|
|
|
# Supports runtime configuration via environment variables
|
|
|
|
|
# ==============================================================================
|
|
|
|
|
|
2026-02-07 10:23:29 -04:00
|
|
|
# Stage 1: Build Angular application
|
|
|
|
|
FROM node:20-alpine AS builder
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy package files
|
|
|
|
|
COPY package*.json ./
|
|
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
|
RUN npm ci --legacy-peer-deps
|
|
|
|
|
|
|
|
|
|
# Copy source code
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Build Angular app for production
|
|
|
|
|
RUN npm run build -- --configuration production
|
|
|
|
|
|
|
|
|
|
# Stage 2: Serve with Nginx
|
|
|
|
|
FROM nginx:alpine
|
|
|
|
|
|
|
|
|
|
# Copy custom nginx configuration
|
|
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
|
|
2026-02-08 18:44:05 -04:00
|
|
|
# Copy built application from builder stage
|
2026-02-07 10:23:29 -04:00
|
|
|
COPY --from=builder /app/dist/goa-gel-frontend/browser /usr/share/nginx/html
|
|
|
|
|
|
2026-02-08 18:44:05 -04:00
|
|
|
# Copy runtime config script
|
|
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
|
|
2026-02-07 10:23:29 -04:00
|
|
|
# Expose port 80
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
# Health check
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
|
|
|
CMD wget --quiet --tries=1 --spider http://localhost/ || exit 1
|
|
|
|
|
|
2026-02-08 18:44:05 -04:00
|
|
|
# Use entrypoint to inject runtime config
|
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
2026-02-07 10:23:29 -04:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|