1. 配置管理
使用 application-prod.yml 分离环境配置。
yaml
spring:
profiles:
active: prod
datasource:
url: ${DB_URL}
username: ${DB_USER}
password: ${DB_PASSWORD}2. 健康检查
启用 Actuator 端点:
yaml
management:
endpoints:
web:
exposure:
include: health,metrics,info3. 日志管理
使用 JSON 格式日志,便于 ELK 收集。
4. 监控告警
集成 Prometheus + Grafana。
5. 容器化
使用多阶段构建减小镜像体积。
评论
0评论加载中…