PingWatch 网络设备离线监控系统
- FastAPI 后端 + Vue 3 前端 - Docker Compose 一键部署 - Casdoor OAuth 认证集成 - LogHive 集中式日志 - 设备批量 CSV 导入/导出 - WebSocket 实时状态推送 - 企业微信告警通知 - fping 高性能并发 Ping 检测 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
services:
|
||||
backend:
|
||||
build: ./backend
|
||||
container_name: pingwatch-backend
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- ./backend/.env
|
||||
environment:
|
||||
- DATABASE_URL=postgresql+asyncpg://pingwatch:pingwatch123@db:5432/pingwatch
|
||||
- TZ=Asia/Shanghai
|
||||
ports:
|
||||
- "8001:8000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- pingwatch_data:/app/data
|
||||
networks:
|
||||
- pingwatch-net
|
||||
cap_add:
|
||||
- NET_RAW # 允许 ICMP ping
|
||||
- NET_ADMIN # 允许原始套接字
|
||||
|
||||
frontend:
|
||||
build: ./frontend
|
||||
container_name: pingwatch-frontend
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
ports:
|
||||
- "8080:80"
|
||||
depends_on:
|
||||
- backend
|
||||
networks:
|
||||
- pingwatch-net
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: pingwatch-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- POSTGRES_DB=pingwatch
|
||||
- POSTGRES_USER=pingwatch
|
||||
- POSTGRES_PASSWORD=pingwatch123
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U pingwatch"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- pingwatch-net
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
pingwatch_data:
|
||||
|
||||
networks:
|
||||
pingwatch-net:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user