Closed tanjianhui1979 closed 4 years ago
为basic和monitor的服务加上hostname如:
services: jce_java: build: ./docker-jce-jre image: pronter/jce-java read_only: true command: echo "jce java" environment: - TZ=Asia/Shanghai gateway: hostname: gateway build: ./api-gateway-ms image: prontera/gateway-ms ports: - "7291:7291" - "10211:10211" depends_on: - 'jce_java' environment: - TZ=Asia/Shanghai
然后在主机hosts文件中为所有服务hostname映射: 127.0.0.1 solar_mysql 127.0.0.1 rabbitmq 127.0.0.1 eureka1 127.0.0.1 eureka2 127.0.0.1 config_server 127.0.0.1 zipkin_server 127.0.0.1 gateway 127.0.0.1 hystrix_dashboard 127.0.0.1 spring_boot_admin 127.0.0.1 zipkin_server 127.0.0.1 account 127.0.0.1 membership 127.0.0.1 product 127.0.0.1 tcc_coordinator
十分感谢,因为当初考虑到是单机学习,所以我直接使用的是localhost进行访问,您的提议也是可以的,我会把这列为一个enhancement。
为basic和monitor的服务加上hostname如:
然后在主机hosts文件中为所有服务hostname映射: 127.0.0.1 solar_mysql 127.0.0.1 rabbitmq 127.0.0.1 eureka1 127.0.0.1 eureka2 127.0.0.1 config_server 127.0.0.1 zipkin_server 127.0.0.1 gateway 127.0.0.1 hystrix_dashboard 127.0.0.1 spring_boot_admin 127.0.0.1 zipkin_server 127.0.0.1 account 127.0.0.1 membership 127.0.0.1 product 127.0.0.1 tcc_coordinator