update
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
toom1996
2026-08-11 22:29:47 +08:00
commit 5a8dbf41cb
62 changed files with 9514 additions and 0 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
# ---- 前端构建阶段 ----
FROM node:22-alpine AS build
WORKDIR /app
# 构建期 SSR 拉数据用的「后端内部地址」。
# 在 docker-compose 里通过 build.args.API_SSR 传入(= http://localhost:8090
# 配合 build.network: host让前端构建容器能访问已启动的 backend 容器)。
ARG API_SSR=http://localhost:8090
ENV API_SSR=$API_SSR
# 运行期浏览器调用地址:置空 = 同源相对路径 /api由下方 nginx 反代到 backend:8090
ENV PUBLIC_API_BASE=""
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# ---- 静态托管阶段 ----
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]