添加了 docker 发布

This commit is contained in:
17792275749
2026-02-06 10:24:43 +08:00
parent ccdf9e9ca6
commit 4e8ff8d777
3 changed files with 42 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
# 1. 第一阶段:构建
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# 2. 根据 MODE 参数执行对应的打包命令
RUN npm run build
# 2. 第二阶段:部署
FROM nginx:stable-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.conf