Merge branch 'main' of https://git.jb18cm.plus/fanfpy/AriStockAI
This commit is contained in:
commit
e2410616df
@ -1,8 +0,0 @@
|
||||
ui_config {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
acl {
|
||||
enabled = false
|
||||
default_policy = "deny"
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
service {
|
||||
name = "data-service"
|
||||
id = "data-service-1"
|
||||
address = "data-service"
|
||||
port = 8000
|
||||
|
||||
check {
|
||||
http = "http://aktools:8080/quote_zh_a_hist?symbol=sh600000&period=daily&start_date=20220101&end_date=20220102"
|
||||
interval = "10s"
|
||||
timeout = "5s"
|
||||
}
|
||||
|
||||
meta = {
|
||||
traefik_enable = "true"
|
||||
traefik_http_routers_data_service_rule = "PathPrefix(`/api/data`)"
|
||||
}
|
||||
}
|
||||
10
consul/config/dev/consul.json
Normal file
10
consul/config/dev/consul.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"data_dir": "/consul/data",
|
||||
"acl": {
|
||||
"default_policy": "deny",
|
||||
"enabled": false
|
||||
},
|
||||
"ui_config": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
18
consul/config/dev/data-service.json
Normal file
18
consul/config/dev/data-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "data-service",
|
||||
"check": {
|
||||
"http": "http://ari-data-service:8000/api/public/stock_bid_ask_em?symbol=000001",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "data-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.data-service.rule=Host(\"data.aristockai.com\")",
|
||||
"traefik.http.routers.data-service.entrypoints=web"
|
||||
],
|
||||
"name": "data-service",
|
||||
"port": 8000
|
||||
}
|
||||
}
|
||||
18
consul/config/dev/emotion-service.json
Normal file
18
consul/config/dev/emotion-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "emotion-service",
|
||||
"check": {
|
||||
"http": "http://emotion-service:8002/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "emotion-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.emotion-service.rule=Host(\"emotion.aristockai.com\")",
|
||||
"traefik.http.routers.emotion-service.entrypoints=web"
|
||||
],
|
||||
"name": "emotion-service",
|
||||
"port": 8002
|
||||
}
|
||||
}
|
||||
18
consul/config/dev/frontend.json
Normal file
18
consul/config/dev/frontend.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "frontend",
|
||||
"check": {
|
||||
"http": "http://frontend:80/",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "frontend-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.frontend.rule=Host(\"aristockai.com\") || Host(\"www.aristockai.com\")",
|
||||
"traefik.http.routers.frontend.entrypoints=web"
|
||||
],
|
||||
"name": "frontend",
|
||||
"port": 80
|
||||
}
|
||||
}
|
||||
18
consul/config/dev/quant-service.json
Normal file
18
consul/config/dev/quant-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "quant-service",
|
||||
"check": {
|
||||
"http": "http://quant-service:8001/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "quant-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.quant-service.rule=Host(\"quant.aristockai.com\")",
|
||||
"traefik.http.routers.quant-service.entrypoints=web"
|
||||
],
|
||||
"name": "quant-service",
|
||||
"port": 8001
|
||||
}
|
||||
}
|
||||
18
consul/config/dev/recommend-service.json
Normal file
18
consul/config/dev/recommend-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "recommend-service",
|
||||
"check": {
|
||||
"http": "http://recommend-service:8003/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "recommend-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.recommend-service.rule=Host(\"recommend.aristockai.com\")",
|
||||
"traefik.http.routers.recommend-service.entrypoints=web"
|
||||
],
|
||||
"name": "recommend-service",
|
||||
"port": 8003
|
||||
}
|
||||
}
|
||||
18
consul/config/dev/user-service.json
Normal file
18
consul/config/dev/user-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "user-service",
|
||||
"check": {
|
||||
"http": "http://user-service:8004/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "user-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.user-service.rule=Host(\"user.aristockai.com\")",
|
||||
"traefik.http.routers.user-service.entrypoints=web"
|
||||
],
|
||||
"name": "user-service",
|
||||
"port": 8004
|
||||
}
|
||||
}
|
||||
20
consul/config/dev/whoami.json
Normal file
20
consul/config/dev/whoami.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"service": {
|
||||
"name": "whoami",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.whoami.entrypoints=web",
|
||||
"traefik.http.routers.whoami.rule=Path(\"/whoami\")",
|
||||
"traefik.http.services.whoami.loadbalancer.server.port=80"
|
||||
],
|
||||
"address": "whoami",
|
||||
"port": 80,
|
||||
"checks": [
|
||||
{
|
||||
"http": "http://whoami:80/",
|
||||
"interval": "10s",
|
||||
"timeout": "2s"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
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`)"
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
service {
|
||||
name = "frontend"
|
||||
id = "frontend-1"
|
||||
address = "frontend"
|
||||
port = 80
|
||||
|
||||
check {
|
||||
http = "http://frontend:80/"
|
||||
interval = "10s"
|
||||
timeout = "5s"
|
||||
}
|
||||
|
||||
meta = {
|
||||
traefik_enable = "true"
|
||||
traefik_http_routers_frontend_rule = "PathPrefix(`/`)"
|
||||
}
|
||||
}
|
||||
10
consul/config/prod/consul.json
Normal file
10
consul/config/prod/consul.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"data_dir": "/consul/data",
|
||||
"acl": {
|
||||
"default_policy": "deny",
|
||||
"enabled": true
|
||||
},
|
||||
"ui_config": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
18
consul/config/prod/data-service.json
Normal file
18
consul/config/prod/data-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "data-service",
|
||||
"check": {
|
||||
"http": "http://ari-data-service:8000/api/public/stock_bid_ask_em?symbol=000001",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "data-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.data-service.rule=Host(\"data.aristockai.com\")",
|
||||
"traefik.http.routers.data-service.entrypoints=web"
|
||||
],
|
||||
"name": "data-service",
|
||||
"port": 8000
|
||||
}
|
||||
}
|
||||
18
consul/config/prod/emotion-service.json
Normal file
18
consul/config/prod/emotion-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "emotion-service",
|
||||
"check": {
|
||||
"http": "http://emotion-service:8002/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "emotion-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.emotion-service.rule=Host(\"emotion.aristockai.com\")",
|
||||
"traefik.http.routers.emotion-service.entrypoints=web"
|
||||
],
|
||||
"name": "emotion-service",
|
||||
"port": 8002
|
||||
}
|
||||
}
|
||||
18
consul/config/prod/frontend.json
Normal file
18
consul/config/prod/frontend.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "frontend",
|
||||
"check": {
|
||||
"http": "http://frontend:80/",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "frontend-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.frontend.rule=Host(\"aristockai.com\") || Host(\"www.aristockai.com\")",
|
||||
"traefik.http.routers.frontend.entrypoints=web"
|
||||
],
|
||||
"name": "frontend",
|
||||
"port": 80
|
||||
}
|
||||
}
|
||||
18
consul/config/prod/quant-service.json
Normal file
18
consul/config/prod/quant-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "quant-service",
|
||||
"check": {
|
||||
"http": "http://quant-service:8001/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "quant-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.quant-service.rule=Host(\"quant.aristockai.com\")",
|
||||
"traefik.http.routers.quant-service.entrypoints=web"
|
||||
],
|
||||
"name": "quant-service",
|
||||
"port": 8001
|
||||
}
|
||||
}
|
||||
18
consul/config/prod/recommend-service.json
Normal file
18
consul/config/prod/recommend-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "recommend-service",
|
||||
"check": {
|
||||
"http": "http://recommend-service:8003/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "recommend-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.recommend-service.rule=Host(\"recommend.aristockai.com\")",
|
||||
"traefik.http.routers.recommend-service.entrypoints=web"
|
||||
],
|
||||
"name": "recommend-service",
|
||||
"port": 8003
|
||||
}
|
||||
}
|
||||
18
consul/config/prod/user-service.json
Normal file
18
consul/config/prod/user-service.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"service": {
|
||||
"address": "user-service",
|
||||
"check": {
|
||||
"http": "http://user-service:8004/health",
|
||||
"interval": "10s",
|
||||
"timeout": "5s"
|
||||
},
|
||||
"id": "user-service-1",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.user-service.rule=Host(\"user.aristockai.com\")",
|
||||
"traefik.http.routers.user-service.entrypoints=web"
|
||||
],
|
||||
"name": "user-service",
|
||||
"port": 8004
|
||||
}
|
||||
}
|
||||
20
consul/config/prod/whoami.json
Normal file
20
consul/config/prod/whoami.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"service": {
|
||||
"name": "whoami",
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.whoami.entrypoints=web",
|
||||
"traefik.http.routers.whoami.rule=Path(\"/whoami\")",
|
||||
"traefik.http.services.whoami.loadbalancer.server.port=80"
|
||||
],
|
||||
"address": "whoami",
|
||||
"port": 80,
|
||||
"checks": [
|
||||
{
|
||||
"http": "http://whoami:80/",
|
||||
"interval": "10s",
|
||||
"timeout": "2s"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
service {
|
||||
name = "quant-service"
|
||||
id = "quant-service-1"
|
||||
address = "quant-service"
|
||||
port = 8001
|
||||
|
||||
check {
|
||||
http = "http://quant-service:8001/health"
|
||||
interval = "10s"
|
||||
timeout = "5s"
|
||||
}
|
||||
|
||||
meta = {
|
||||
traefik_enable = "true"
|
||||
traefik_http_routers_quant_service_rule = "PathPrefix(`/api/quant`)"
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
service {
|
||||
name = "recommend-service"
|
||||
id = "recommend-service-1"
|
||||
address = "recommend-service"
|
||||
port = 8003
|
||||
|
||||
check {
|
||||
http = "http://recommend-service:8003/health"
|
||||
interval = "10s"
|
||||
timeout = "5s"
|
||||
}
|
||||
|
||||
meta = {
|
||||
traefik_enable = "true"
|
||||
traefik_http_routers_recommend_service_rule = "PathPrefix(`/api/recommend`)"
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
service {
|
||||
name = "user-service"
|
||||
id = "user-service-1"
|
||||
address = "user-service"
|
||||
port = 8004
|
||||
|
||||
check {
|
||||
http = "http://user-service:8004/health"
|
||||
interval = "10s"
|
||||
timeout = "5s"
|
||||
}
|
||||
|
||||
meta = {
|
||||
traefik_enable = "true"
|
||||
traefik_http_routers_user_service_rule = "PathPrefix(`/api/user`)"
|
||||
}
|
||||
}
|
||||
@ -13,8 +13,8 @@ services:
|
||||
- "8500:8500" # Consul Web UI
|
||||
- "8600:8600/udp" # DNS服务
|
||||
volumes:
|
||||
- ./consul/config:/consul/config
|
||||
command: "consul agent -dev -config-dir=/consul/config -client=0.0.0.0"
|
||||
- ./consul/config/${ENV_CONFIG_DIR}:/consul/config
|
||||
command: "consul agent ${CONSUL_DEV_MODE} -config-dir=/consul/config -client=0.0.0.0"
|
||||
networks:
|
||||
- microservice-network
|
||||
healthcheck:
|
||||
@ -24,41 +24,25 @@ services:
|
||||
retries: 3
|
||||
|
||||
traefik:
|
||||
image: traefik:v2.9
|
||||
image: traefik:v2.11
|
||||
container_name: ari-traefik
|
||||
restart: always
|
||||
depends_on:
|
||||
consul:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "80:80" # 主入口
|
||||
- "8080:8080" # Dashboard
|
||||
volumes:
|
||||
- ./traefik/traefik.yml:/etc/traefik/traefik.yml
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
command:
|
||||
- --providers.consulcatalog=true
|
||||
- --providers.consulcatalog.endpoint.address=consul:8500
|
||||
- --providers.consulcatalog.exposedbydefault=false
|
||||
- --api.dashboard=true
|
||||
- --log.level=INFO
|
||||
- --configFile=/etc/traefik/traefik.yml
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:8080" # Traefik dashboard
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./traefik/config/${TRAEFIK_CONFIG_DIR}/traefik.yml:/etc/traefik/traefik.yml
|
||||
networks:
|
||||
- microservice-network
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.traefik-dashboard.rule=PathPrefix(`/dashboard`) || PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.traefik-dashboard.service=api@internal"
|
||||
- "traefik.http.routers.traefik-dashboard.entrypoints=web"
|
||||
|
||||
data-service:
|
||||
build: ./services/data-service
|
||||
container_name: ari-data-service
|
||||
restart: always
|
||||
depends_on:
|
||||
consul:
|
||||
condition: service_healthy
|
||||
expose:
|
||||
- "8000"
|
||||
ports:
|
||||
- "8000:8000"
|
||||
networks:
|
||||
- microservice-network
|
||||
environment:
|
||||
@ -135,4 +119,10 @@ services:
|
||||
networks:
|
||||
- microservice-network
|
||||
environment:
|
||||
- SERVICE_NAME=frontend
|
||||
- SERVICE_NAME=frontend
|
||||
|
||||
whoami:
|
||||
image: traefik/whoami
|
||||
container_name: whoami
|
||||
networks:
|
||||
- microservice-network
|
||||
|
||||
14
traefik/config/dev/traefik.yml
Normal file
14
traefik/config/dev/traefik.yml
Normal file
@ -0,0 +1,14 @@
|
||||
entryPoints:
|
||||
web:
|
||||
address: ":80"
|
||||
|
||||
|
||||
providers:
|
||||
consulCatalog:
|
||||
endpoint:
|
||||
address: "ari-consul:8500"
|
||||
exposedByDefault: true
|
||||
|
||||
api:
|
||||
dashboard: true
|
||||
insecure: true
|
||||
21
traefik/config/prod/traefik.yml
Normal file
21
traefik/config/prod/traefik.yml
Normal file
@ -0,0 +1,21 @@
|
||||
entryPoints:
|
||||
web:
|
||||
address: ":80"
|
||||
http:
|
||||
redirections:
|
||||
entryPoint:
|
||||
to: websecure
|
||||
scheme: https
|
||||
websecure:
|
||||
address: ":443"
|
||||
|
||||
|
||||
providers:
|
||||
consulCatalog:
|
||||
endpoint:
|
||||
address: "ari-consul:8500"
|
||||
exposedByDefault: false
|
||||
|
||||
api:
|
||||
dashboard: true
|
||||
insecure: false
|
||||
@ -1,7 +0,0 @@
|
||||
entryPoints:
|
||||
web:
|
||||
address: ":80"
|
||||
http:
|
||||
middlewares:
|
||||
compress:
|
||||
compress: true
|
||||
Loading…
Reference in New Issue
Block a user