feat: 添加 Dockerfile、docker-compose 及 K8s kustomize 部署文件

This commit is contained in:
2026-06-15 16:49:35 +08:00
parent fd1bac551c
commit eeea55e9e4
18 changed files with 587 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
# ===== Stage 1: Build =====
FROM node:22-alpine AS builder
WORKDIR /app
# Install pnpm
RUN corepack enable && corepack prepare pnpm@10 --activate
# Copy package manifests
COPY frontend/package.json frontend/pnpm-lock.yaml ./
# Install deps
RUN pnpm install --frozen-lockfile
# Copy source
COPY frontend/ ./
# Build
RUN pnpm build
# ===== Stage 2: Serve with nginx =====
FROM nginx:alpine
# Copy built assets
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx config
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]