refactor(consul): 统一服务配置使用服务名和标准端口 更新Dockerfile中的Python基础镜像版本以使用更稳定的3.11版本 修改consul配置文件中服务检查地址和端口,使用服务名替代IP地址并统一端口号
20 lines
700 B
JSON
20 lines
700 B
JSON
{
|
|
"service": {
|
|
"address": "emotion-service",
|
|
"check": {
|
|
"http": "http://emotion-service:8002/health",
|
|
"interval": "10s",
|
|
"timeout": "5s"
|
|
},
|
|
"id": "emotion-service",
|
|
"tags": [
|
|
"traefik.enable=true",
|
|
"traefik.http.routers.emotion-service.rule=PathPrefix(`/api/emotion`) || PathPrefix(`/api/sentiment`)",
|
|
"traefik.http.routers.emotion-service.entrypoints=web",
|
|
"traefik.http.middlewares.emotion-service-stripprefix.stripprefix.prefixes=/api/emotion,/api/sentiment",
|
|
"traefik.http.routers.emotion-service.middlewares=emotion-service-stripprefix@consulcatalog"
|
|
],
|
|
"name": "emotion-service",
|
|
"port": 8002
|
|
}
|
|
} |