[BACKEND] Initialize Go backend structure and dependencies (#23)
This commit is contained in:
@@ -1,37 +1,33 @@
|
||||
# ==========================================
|
||||
# Chat Switchboard Frontend Dockerfile
|
||||
# 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 - using alpine, no Node.js needed (build.sh is just bash)
|
||||
# Build stage
|
||||
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
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy custom nginx config
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# Static-only nginx config (no /api/ proxy)
|
||||
COPY nginx.frontend.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copy built standalone files
|
||||
# Built SPA 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;"]
|
||||
Reference in New Issue
Block a user