# ========================================== # Chat Switchboard Frontend Dockerfile # ========================================== # Build stage - using alpine, no Node.js needed (build.sh is just bash) FROM alpine:3.19 AS builder WORKDIR /app # Install bash and required tools RUN apk add --no-cache bash coreutils # Copy build script and source COPY build.sh ./ COPY src ./src # Make build script executable and run it RUN chmod +x build.sh && ./build.sh # Production stage FROM nginx:alpine AS production # Copy custom nginx config COPY nginx.conf /etc/nginx/conf.d/default.conf # Copy built standalone files COPY --from=builder /app/standalone /usr/share/nginx/html # Expose port EXPOSE 80 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1 # Run nginx CMD ["nginx", "-g", "daemon off;"]