# 任务中台管理端 **Repository Path**: unihao/task-center-front ## Basic Information - **Project Name**: 任务中台管理端 - **Description**: 任务中台管理端 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-06 - **Last Updated**: 2025-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Task Center Frontend 任务中心前端项目,基于 Vue 3 + Element Plus 构建。 ## 快速开始 ### 使用部署脚本(推荐) ```bash # 一键部署 ./deploy.sh # 开发环境 ./dev.sh start ./dev.sh logs ./dev.sh stop ``` ### 手动部署 ```bash # 构建并启动 docker-compose up --build -d # 查看日志 docker-compose logs -f # 停止服务 docker-compose down ``` ## 项目结构 ``` task-center-front/ ├── src/ # 源代码 ├── public/ # 静态资源 ├── Dockerfile # Docker 构建文件 ├── docker-compose.yml # Docker Compose 配置 ├── nginx.conf # Nginx 主配置 ├── default.conf # Nginx 服务配置 ├── start.sh # 容器启动脚本 ├── deploy.sh # 部署脚本 ├── dev.sh # 开发环境脚本 └── README.md # 项目文档 ``` ## 配置说明 ### 环境要求 - Docker 20.10+ - Docker Compose 2.0+ - Node.js 18+ (仅开发环境) ### 端口配置 - 前端服务:80 端口 - 健康检查:http://localhost/health ### 网络配置 - 前端容器连接到 `task-center-network` 网络 - 通过 Nginx 反向代理访问后端服务 `task-center:8080` ## 开发指南 ### 本地开发 ```bash # 安装依赖 npm install # 启动开发服务器 npm run dev # 构建生产版本 npm run build ``` ### Docker 开发 ```bash # 启动开发环境 ./dev.sh start # 查看日志 ./dev.sh logs # 重启服务 ./dev.sh restart # 清理环境 ./dev.sh clean ``` ## 部署指南 ### 生产环境部署 ```bash # 完整部署 ./deploy.sh # 或手动部署 docker-compose up --build -d ``` ### 环境变量 - `NODE_ENV=production`:生产环境标识 ### 资源限制 - 内存限制:512MB - CPU 限制:0.5 核 - 日志轮转:10MB,保留 3 个文件 ## 健康检查 服务提供以下健康检查端点: - `GET /health`:基础健康检查 - 容器健康检查:每 30 秒检查一次 ## 故障排除 ### 常见问题 1. **端口冲突** ```bash # 检查端口占用 netstat -tulpn | grep :80 ``` 2. **容器启动失败** ```bash # 查看详细日志 docker-compose logs frontend ``` 3. **网络连接问题** ```bash # 检查容器网络 docker network ls docker inspect task-center-front ``` ### 调试命令 ```bash # 进入容器 docker exec -it task-center-front sh # 检查 Nginx 配置 nginx -t # 查看 Nginx 日志 cat /var/log/nginx/error.log # 测试后端连接 curl http://task-center:8080/api/task/page ``` ## 维护指南 ### 更新部署 ```bash # 重新构建并部署 ./deploy.sh # 或手动更新 docker-compose down docker-compose build --no-cache docker-compose up -d ``` ### 日志管理 ```bash # 查看实时日志 docker-compose logs -f frontend # 查看历史日志 docker logs task-center-front ``` ### 备份和恢复 ```bash # 备份镜像 docker save task-center-front:latest > task-center-front.tar # 恢复镜像 docker load < task-center-front.tar ``` ## 许可证 本项目采用 MIT 许可证。