bruno 249b540e36 STDIN
1 feat: 添加 Docker 和本地启动方案,集成监控工具
   2
   3 ## Docker Compose 方案
   4 - 创建 docker-compose.yml 主配置文件
   5 - 为所有服务创建 Dockerfile:
   6   - backend/Dockerfile (Python 后端)
   7   - llm-service/Dockerfile (LLM 服务)
   8   - web-dashboard/Dockerfile (前端,多阶段构建 + Nginx)
   9   - edge-ai/Dockerfile (边缘 AI 服务)
  10 - 配置 nginx.conf 用于前端生产部署
  11 - 集成 Portainer 容器管理工具 (端口 9000)
  12 - 配置健康检查和服务依赖
  13 - 创建 .dockerignore 优化镜像构建
  14
  15 ## Shell 脚本方案
  16 - scripts/start.sh - 本地环境一键启动
  17 - scripts/stop.sh - 优雅停止所有服务
  18 - scripts/logs.sh - 灵活的日志查看工具
  19 - scripts/status.sh - 实时服务状态监控
  20 - 支持后台运行和 PID 管理
  21 - 彩色输出和友好提示
  22
  23 ## Makefile 统一入口
  24 - Docker 命令:docker-up, docker-down, docker-logs, docker-status
  25 - 本地命令:local-start, local-stop, local-logs, local-status
  26 - 维护工具:install, test, clean, clean-all
  27 - 快捷命令:up, down, logs, status, restart
  28 - 完整的帮助信息 (make help)
  29
  30 ## 文档完善
  31 - 创建详细的 DEPLOYMENT.md 部署指南
  32   - Docker 和本地两种部署方式
  33   - 完整的命令参考
  34   - 故障排查指南
  35   - 生产环境部署建议
  36 - 更新 README.md 添加快速启动指南
  37 - 创建 .env.example 环境变量模板
  38
  39 ## 监控和管理
  40 - 集成 Portainer 用于容器可视化管理
  41 - 实时日志跟踪功能
  42 - 服务健康检查
  43 - 资源使用监控
  44
  45 ## 特性
  46 ✅ 一键启动所有服务
  47 ✅ 自动处理服务依赖
  48 ✅ 支持开发和生产环境
  49 ✅ 完整的日志管理
  50 ✅ 服务状态实时监控
  51 ✅ 友好的命令行界面
  52
  53 🤖 Generated with [Claude Code](https://claude.com/claude-code)
  54
  55 Co-Authored-By: Claude <[email protected]>
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 13:05:12 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00
2025-11-21 15:45:08 +08:00

香蜜湖公园视频 AI 安全&卫生治理系统

一个基于视频AI的园区安全与环境监测系统,支持多种告警类型的实时检测与管理。

系统架构

park_alert/
├── edge-ai/              # 边缘视频AI服务 (Python + YOLOv8)
├── backend/              # 中央后端服务 (FastAPI)
├── web-dashboard/        # 大屏前端 (Vue3 + Vite)
├── llm-service/          # 大模型解释服务 (FastAPI + Claude)
└── docs/                 # 文档

功能特性

  • ✅ 抽烟告警
  • ✅ 跌倒告警
  • ✅ 烟雾/火焰告警
  • ✅ 垃圾告警
  • ✅ 打架斗殴告警(基础检测)

🚀 快速开始

方式一:Docker 一键启动(推荐)

最简单的启动方式,适合生产环境和快速演示:

# 1. 配置环境变量
cp .env.example .env
# 编辑 .env 文件,设置 OPENROUTER_API_KEY

# 2. 一键启动所有服务
make docker-up

# 3. 访问服务
# 前端大屏: http://localhost:5173
# 后端 API: http://localhost:8000/docs
# LLM 服务: http://localhost:8001/docs
# Portainer 监控: http://localhost:9000

常用命令:

make docker-status  # 查看服务状态
make docker-logs    # 查看日志
make docker-down    # 停止服务
make help           # 查看所有可用命令

方式二:本地开发环境

适合开发调试,代码修改实时生效:

环境要求:

  • Python 3.10+
  • Node.js 18+
  • PostgreSQL 14+

启动步骤:

# 1. 安装依赖
make install

# 2. 启动数据库(Docker 方式)
docker run -d --name park_alert_postgres \
  -e POSTGRES_DB=park_alert \
  -e POSTGRES_USER=park_user \
  -e POSTGRES_PASSWORD=park_pass_2024 \
  -p 5432:5432 postgres:14-alpine

# 3. 启动所有服务
make local-start

# 4. 访问服务
# 前端大屏: http://localhost:5173
# 后端 API: http://localhost:8000/docs
# LLM 服务: http://localhost:8001/docs

常用命令:

make local-status   # 查看服务状态
make local-logs     # 查看日志
make local-stop     # 停止服务

服务管理

# 查看所有可用命令
make help

# 查看服务状态
make status         # Docker 方式
make local-status   # 本地方式

# 查看实时日志
make logs           # Docker 方式
./scripts/logs.sh backend -f  # 本地方式

# 重启服务
make restart        # Docker 方式
make local-restart  # 本地方式

# 清理环境
make clean          # 清理日志
make clean-all      # 完全清理(包括数据)

📚 文档

技术栈

  • 边缘AI: Python, YOLOv8, OpenCV, PyTorch
  • 后端: FastAPI, SQLAlchemy, PostgreSQL
  • 前端: Vue3, Vite, TypeScript, Element Plus
  • AI服务: Claude API, OpenRouter

许可证

专有软件

S
Description
No description provided
Readme
126 KiB
Languages
Python 62.2%
Vue 15.3%
Shell 8.3%
TypeScript 8.2%
Makefile 3.1%
Other 2.9%