34 lines
889 B
Docker
34 lines
889 B
Docker
# ==========================================
|
|
# Chat Switchboard - Frontend Dockerfile
|
|
# ==========================================
|
|
# Static SPA served by nginx. No API proxy —
|
|
# in cluster mode, the Ingress routes /api/ to
|
|
# the backend service directly.
|
|
# Also used for the lite (unmanaged) deployment.
|
|
# ==========================================
|
|
|
|
# Build stage
|
|
FROM alpine:3.19 AS builder
|
|
|
|
WORKDIR /app
|
|
RUN apk add --no-cache bash coreutils
|
|
|
|
COPY build.sh ./
|
|
COPY src ./src
|
|
|
|
RUN chmod +x build.sh && ./build.sh
|
|
|
|
# Production stage
|
|
FROM nginx:alpine
|
|
|
|
# Static-only nginx config (no /api/ proxy)
|
|
COPY nginx.frontend.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Built SPA files
|
|
COPY --from=builder /app/standalone /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
|