feat: 添加 Dockerfile、docker-compose 及 K8s kustomize 部署文件
This commit is contained in:
@@ -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;"]
|
||||
Reference in New Issue
Block a user