fix(traefik): 修正服务端口注释并更新路由规则为基于域名

将docker-compose.yml中的错误注释修正为服务端口注释
将所有服务的路由规则从PathPrefix改为基于域名的Host规则
移除data-service中不再需要的路径前缀中间件配置
This commit is contained in:
fanfpy 2025-07-06 12:42:38 +08:00
parent 5af50cc066
commit dc04f20856
7 changed files with 8 additions and 10 deletions

View File

@ -9,10 +9,8 @@
"id": "data-service-1", "id": "data-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.data-service.rule=PathPrefix(\"/api/data\")", "traefik.http.routers.data-service.rule=Host(\"data.aristockai.com\")",
"traefik.http.routers.data-service.entrypoints=web", "traefik.http.routers.data-service.entrypoints=web"
"traefik.http.middlewares.data-service-strip.stripprefix.prefixes=/api/data",
"traefik.http.routers.data-service.middlewares=data-service-strip"
], ],
"name": "data-service", "name": "data-service",
"port": 8000 "port": 8000

View File

@ -9,7 +9,7 @@
"id": "emotion-service-1", "id": "emotion-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.emotion-service.rule=PathPrefix(\"/api/emotion\")", "traefik.http.routers.emotion-service.rule=Host(\"emotion.aristockai.com\")",
"traefik.http.routers.emotion-service.entrypoints=web" "traefik.http.routers.emotion-service.entrypoints=web"
], ],
"name": "emotion-service", "name": "emotion-service",

View File

@ -9,7 +9,7 @@
"id": "frontend-1", "id": "frontend-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.frontend.rule=PathPrefix(\"/frontend\")", "traefik.http.routers.frontend.rule=Host(\"aristockai.com\") || Host(\"www.aristockai.com\")",
"traefik.http.routers.frontend.entrypoints=web" "traefik.http.routers.frontend.entrypoints=web"
], ],
"name": "frontend", "name": "frontend",

View File

@ -9,7 +9,7 @@
"id": "quant-service-1", "id": "quant-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.quant-service.rule=PathPrefix(\"/api/quant\")", "traefik.http.routers.quant-service.rule=Host(\"quant.aristockai.com\")",
"traefik.http.routers.quant-service.entrypoints=web" "traefik.http.routers.quant-service.entrypoints=web"
], ],
"name": "quant-service", "name": "quant-service",

View File

@ -9,7 +9,7 @@
"id": "recommend-service-1", "id": "recommend-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.recommend-service.rule=PathPrefix(\"/api/recommend\")", "traefik.http.routers.recommend-service.rule=Host(\"recommend.aristockai.com\")",
"traefik.http.routers.recommend-service.entrypoints=web" "traefik.http.routers.recommend-service.entrypoints=web"
], ],
"name": "recommend-service", "name": "recommend-service",

View File

@ -9,7 +9,7 @@
"id": "user-service-1", "id": "user-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.user-service.rule=PathPrefix(\"/api/user\")", "traefik.http.routers.user-service.rule=Host(\"user.aristockai.com\")",
"traefik.http.routers.user-service.entrypoints=web" "traefik.http.routers.user-service.entrypoints=web"
], ],
"name": "user-service", "name": "user-service",

View File

@ -42,7 +42,7 @@ services:
container_name: ari-data-service container_name: ari-data-service
restart: always restart: always
ports: ports:
- "8000:8000" # Traefik dashboard - "8000:8000" # 错误:应为服务端口注释而非Traefik dashboard
networks: networks:
- microservice-network - microservice-network
environment: environment: