This commit is contained in:
2026-02-03 19:37:58 +08:00
parent 8ffe3e0e15
commit db4a0b109c
42 changed files with 6594 additions and 183 deletions

View File

@@ -1,16 +1,3 @@
# # 使用 Nginx 官方轻量镜像
# FROM nginx:1.25-alpine
# # 拷贝前端构建产物
# COPY dist/ /usr/share/nginx/html/
# # 暴露端口
# EXPOSE 80
# CMD ["nginx", "-g", "daemon off;"]
# 第一阶段:构建阶段 - 使用指定node20.15.0版本安装pnpm
FROM node:20.15.0-alpine AS builder
@@ -46,7 +33,7 @@ FROM nginx:stable-alpine
EXPOSE 80
# 可选替换Nginx默认配置解决前端路由刷新404、开启gzip压缩优化静态资源
# COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# COPY ./default.conf /etc/nginx/conf.d/default.conf
# 从构建阶段builder复制构建后的dist目录到Nginx的静态资源根目录
COPY --from=builder /app/dist /usr/share/nginx/html