Files
hzhub/hzhub-portal-employee/Dockerfile.frontend
大壮 278e507e8a feat: 添加员工门户项目及相关后端改造
- 新增 hzhub-portal-employee 员工门户前端项目(基于 Vue3 + Element Plus)
- 后端登录接口增加返回 nickName 字段
- 移除 KnowledgeInfoController 的 @SaCheckPermission 注解
- 删除 hzhub-portal-company 旧门户项目
- 更新项目文档和架构说明
- 添加后台运行管理脚本(start-all.sh / status-all.sh / stop-all.sh)
- 更新 docker-compose 配置

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 03:47:33 +00:00

45 lines
979 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 构建阶段
FROM node:22-alpine AS builder
# 接收构建参数
ARG VITE_API_URL
ARG VITE_APP_ENV=production
# 设置环境变量
ENV VITE_API_URL=${VITE_API_URL}
ENV VITE_APP_ENV=${VITE_APP_ENV}
# 设置工作目录
WORKDIR /app
# 复制 package 文件
COPY package.json pnpm-lock.yaml ./
# 安装 pnpm 并安装依赖
RUN npm install -g pnpm && \
pnpm install --frozen-lockfile
# 复制源代码
COPY . .
# 构建生产版本(使用 production 模式)
RUN pnpm build
# 生产阶段
FROM nginx:alpine
# 复制构建产物
COPY --from=builder /app/dist /usr/share/nginx/html
# 设置后端地址环境变量(默认指向本机 6039 端口)
ENV UPSTREAM_URL=http://127.0.0.1:6039
# 复制 Nginx 配置并使用 envsubst 替换环境变量
COPY nginx.conf /etc/nginx/templates/default.conf.template
# 暴露端口
EXPOSE 5137
# 启动 Nginxdocker-compose 中可通过环境变量 UPSTREAM_URL 覆盖后端地址)
CMD ["nginx", "-g", "daemon off;"]