122 lines
2.9 KiB
YAML
122 lines
2.9 KiB
YAML
# Gateway Docker环境配置
|
|
server:
|
|
port: 9000
|
|
|
|
spring:
|
|
application:
|
|
name: emotion-gateway
|
|
profiles:
|
|
active: docker
|
|
cloud:
|
|
nacos:
|
|
discovery:
|
|
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
|
|
namespace: public
|
|
group: DEFAULT_GROUP
|
|
config:
|
|
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
|
|
file-extension: yml
|
|
namespace: public
|
|
group: DEFAULT_GROUP
|
|
gateway:
|
|
discovery:
|
|
locator:
|
|
enabled: true
|
|
lower-case-service-id: true
|
|
routes:
|
|
# AI服务路由
|
|
- id: emotion-ai
|
|
uri: lb://emotion-ai
|
|
predicates:
|
|
- Path=/api/ai/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# 用户服务路由
|
|
- id: emotion-user
|
|
uri: lb://emotion-user
|
|
predicates:
|
|
- Path=/api/user/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# 记录服务路由
|
|
- id: emotion-record
|
|
uri: lb://emotion-record
|
|
predicates:
|
|
- Path=/api/record/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# 成长服务路由
|
|
- id: emotion-growth
|
|
uri: lb://emotion-growth
|
|
predicates:
|
|
- Path=/api/growth/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# 探索服务路由
|
|
- id: emotion-explore
|
|
uri: lb://emotion-explore
|
|
predicates:
|
|
- Path=/api/explore/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# 奖励服务路由
|
|
- id: emotion-reward
|
|
uri: lb://emotion-reward
|
|
predicates:
|
|
- Path=/api/reward/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# 统计服务路由
|
|
- id: emotion-stats
|
|
uri: lb://emotion-stats
|
|
predicates:
|
|
- Path=/api/stats/**
|
|
filters:
|
|
- StripPrefix=1
|
|
globalcors:
|
|
cors-configurations:
|
|
'[/**]':
|
|
allowedOriginPatterns: "*"
|
|
allowedMethods: "*"
|
|
allowedHeaders: "*"
|
|
allowCredentials: true
|
|
|
|
# 数据源配置
|
|
datasource:
|
|
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
|
username: root
|
|
password: 123456
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
|
|
# Redis配置
|
|
redis:
|
|
host: ${REDIS_HOST:redis}
|
|
port: ${REDIS_PORT:6379}
|
|
password:
|
|
database: 0
|
|
timeout: 6000ms
|
|
lettuce:
|
|
pool:
|
|
max-active: 8
|
|
max-wait: -1ms
|
|
max-idle: 8
|
|
min-idle: 0
|
|
|
|
# 日志配置
|
|
logging:
|
|
level:
|
|
com.emotionmuseum: DEBUG
|
|
org.springframework.cloud.gateway: DEBUG
|
|
pattern:
|
|
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"
|
|
|
|
# 管理端点
|
|
management:
|
|
endpoints:
|
|
web:
|
|
exposure:
|
|
include: health,info,metrics,prometheus
|
|
endpoint:
|
|
health:
|
|
show-details: always
|