- Add Helm chart with 19 templates (Deployments, Services, Ingress, ConfigMaps, Secrets, NetworkPolicy, cert-manager) - Add Dockerfiles for 4 microservices (dashboard, data-service, execute-service, news-service) - Add CI/CD workflows (build-test, build-push, deploy) - Add raw K8s manifests, per-service Helm charts, and deploy scripts - Add SOPS-encrypted secrets template and config - Configure deployment to customer1 namespace - Include infrastructure components: PostgreSQL, Redis, Kafka
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
# =============================================================================
|
|
# Dashboard Dockerfile — Next.js multi-stage build with static export
|
|
# =============================================================================
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first (better layer caching)
|
|
COPY trading-platform/dashboard/package*.json ./
|
|
RUN npm ci
|
|
|
|
# Copy source and build
|
|
COPY trading-platform/dashboard/ ./
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM node:20-alpine AS production
|
|
|
|
# Security: non-root user
|
|
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built output and package.json from builder
|
|
COPY --from=builder /app/package.json ./package.json
|
|
COPY --from=builder /app/.next/standalone ./
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
COPY --from=builder /app/public ./public
|
|
|
|
USER nextjs
|
|
|
|
EXPOSE 3000
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
|
|
|
|
CMD ["node", "server.js"]
|