- 移除各服务的独立注册脚本,改为通过Consul配置文件集中管理 - 为所有服务添加健康检查端点 - 更新docker-compose配置,添加网络和健康检查依赖 - 修改data-service的启动命令和端口配置 - 禁用Consul的ACL以简化开发环境配置
17 lines
339 B
HCL
17 lines
339 B
HCL
service {
|
|
name = "emotion-service"
|
|
id = "emotion-service-1"
|
|
address = "emotion-service"
|
|
port = 8002
|
|
|
|
check {
|
|
http = "http://emotion-service:8002/health"
|
|
interval = "10s"
|
|
timeout = "5s"
|
|
}
|
|
|
|
meta = {
|
|
"traefik.enable" = "true"
|
|
"traefik.http.routers.emotion-service.rule" = "PathPrefix(`/api/emotion`)"
|
|
}
|
|
} |