优化更新
This commit is contained in:
@@ -18,16 +18,14 @@
|
||||
Flask 应用提供健康检查路由,可用于负载均衡器或容器编排的探针配置:
|
||||
|
||||
```bash
|
||||
# 基础健康检查
|
||||
GET /api/v1/health
|
||||
# 基础健康检查(无需认证,已在登录白名单中)
|
||||
GET /health
|
||||
|
||||
# 响应示例
|
||||
{
|
||||
"code": 0,
|
||||
"data": {
|
||||
"status": "healthy",
|
||||
"version": "1.0.0",
|
||||
"uptime": 3600
|
||||
"status": "ok"
|
||||
},
|
||||
"msg": "操作成功",
|
||||
"ok": true
|
||||
@@ -38,7 +36,7 @@ GET /api/v1/health
|
||||
在 Dockerfile 中配置 HEALTHCHECK:
|
||||
```dockerfile
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
||||
CMD curl -f http://localhost:8021/api/v1/health || exit 1
|
||||
CMD curl -f http://localhost:8021/health || exit 1
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -79,7 +77,7 @@ HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
||||
|
||||
```
|
||||
2026-09-05 10:30:15 [INFO] src.app: Application startup complete
|
||||
2026-09-05 10:30:16 [WARNING] src.middleware.rate_limit: Rate limit exceeded for 192.168.1.100
|
||||
2026-09-05 10:30:16 [WARNING] src.middleware.auth: Login attempt locked for user admin from 192.168.1.100
|
||||
2026-09-05 10:30:17 [ERROR] src.modules.auth.service: Login failed for user admin
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user