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