配置文件添加读取环境变量的支持:

作用:
1.通过加持环境变量让运行更加灵活;
2.支持Docker官方的Docker Swarm多主机的集群支持;
说明:
defaultZone: http://pig:pig@${EUREKA-HOST:pigx-eureka}:${EUREKA-PORT:8761}/eureka/
如果配置了大括号里面的冒号前面的环境变量则使用,否则使用冒号后面的默认值.
This commit is contained in:
dbdu committed 2019-04-03 16:15:55 +08:00
1 parent 56a2f1ebdf
commit b024fe5695
21 files changed
+42 -42

No files matched your search

@@ -22,4 +22,4 @@ eureka:
prefer-ip-address: true
client:
service-url:
defaultZone: http://pig:pig@pigx-eureka:8761/eureka/
defaultZone: http://pig:pig@${EUREKA-HOST:pigx-eureka}:${EUREKA-PORT:8761}/eureka/