consul update

This commit is contained in:
dzj 2024-01-08 06:31:25 +08:00
parent 69983d0efb
commit 44a23ac542
2 changed files with 14 additions and 4 deletions

View File

@ -35,7 +35,7 @@ services:
- "--api.insecure=true" - "--api.insecure=true"
- "--api.debug=false" - "--api.debug=false"
- "--ping=true" - "--ping=true"
- "--log.level=INFO" - "--log.level=DEBUG"
- "--log.format=common" - "--log.format=common"
- "--accesslog=false" - "--accesslog=false"
- "--entrypoints.web.address=:8081" - "--entrypoints.web.address=:8081"
@ -53,6 +53,11 @@ services:
- "--providers.file.watch=true" - "--providers.file.watch=true"
- "--providers.file.directory=/etc/traefik/dynamic" - "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.debugloggeneratedtemplate=true" - "--providers.file.debugloggeneratedtemplate=true"
- "--providers.consulCatalog=true"
- "--providers.consulCatalog.endpoint.address=consul:8500"
- "--providers.consulCatalog.exposedByDefault=false"
- "--providers.consulCatalog.stale=false"
- "--providers.consulCatalog.prefix=traefik"
healthcheck: healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy off localhost:8080/ping || exit 1"] test: ["CMD-SHELL", "wget -q --spider --proxy off localhost:8080/ping || exit 1"]
interval: 5s interval: 5s

View File

@ -33,8 +33,8 @@ spring:
compatibility-verifier: compatibility-verifier:
enabled: false enabled: false
consul: consul:
host: localhost host: ${CONSUL_HOST:consul}
port: 8500 port: ${CONSUL_PORT:8500}
discovery: discovery:
register-health-check: true register-health-check: true
healthCheckPath: ${server.servlet.context-path}/actuator/health healthCheckPath: ${server.servlet.context-path}/actuator/health
@ -43,7 +43,12 @@ spring:
metrics: ${server.servlet.context-path}/actuator/prometheus metrics: ${server.servlet.context-path}/actuator/prometheus
springboot: true springboot: true
isv: risesoft isv: risesoft
tags: test,y9 tags:
- traefik.enable=true
- traefik.http.routers.demo01.rule=PathPrefix(`/users`,`/actuator`)
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.application.instance-id:${random.value}}
service-name: ${spring.application.name}
datasource: datasource:
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/y9_public?serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&useCompression=true&useSSL=false&allowPublicKeyRetrieval=true url: jdbc:mysql://localhost:3306/y9_public?serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&useCompression=true&useSSL=false&allowPublicKeyRetrieval=true