blob: deb81af274e6d024be984e3781d163915f590aa4 [file] [log] [blame]
# 构建阶段
FROM node:23-alpine AS builder
WORKDIR /src
# 安装 pnpm
RUN npm install -g pnpm
# 复制依赖文件并安装
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# 复制源码并构建
COPY . .
RUN pnpm build
# 生产环境
FROM nginx:1.25-alpine
COPY --from=builder /src/dist /usr/share/nginx/html
COPY 50x.html /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]