🐛 docker compose service name 에 '-' 들어가면 내부 통신 오류

This commit is contained in:
kimjaeyeol
2021-10-26 18:30:43 +09:00
parent ee31138c58
commit 6e9e985e27
3 changed files with 16 additions and 29 deletions

View File

@@ -15,6 +15,6 @@ eureka:
register-with-eureka: false
fetch-registry: false
service-url:
defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@localhost:8761/eureka
defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname:localhost}:8761/eureka
server:
peer-node-read-timeout-ms: 10000

View File

@@ -12,7 +12,7 @@ eureka:
register-with-eureka: true # eureka 서버에 등록
fetch-registry: true # 외부 검색 가능
service-url:
defaultZone: http://admin:admin@localhost:8761/eureka
defaultZone: http://admin:admin@${eureka.instance.hostname:localhost}:8761/eureka
# file attach location - messages{lang}.properties 도 이 경로에 위치한다.
file:

View File

@@ -1,52 +1,43 @@
version: '3'
services:
egov-config:
container_name: egov-config
hostname: egov-config
config:
container_name: config
image: egovframe/msa-edu-config:latest
ports:
- "8888:8888"
# restart: always
# networks:
# - egov-network
restart: always
volumes:
- ${HOME}/workspace/egovframe-msa-edu/config:/usr/app/config # volume bind
environment:
ENCRYPT_KEY: token_secret
TZ: Asia/Seoul
egov-discovery:
container_name: egov-discovery
discovery:
container_name: discovery
image: egovframe/msa-discovery:latest
ports:
- "8761:8761"
# restart: always
# networks:
# - egov-network
restart: always
environment:
SPRING_PROFILES_ACTIVE: default
EUREKA_INSTANCE_HOSTNAME: discovery
TZ: Asia/Seoul
egov-apigateway:
container_name: egov-apigateway
apigateway:
container_name: apigateway
image: egovframe/msa-apigateway:latest
ports:
- "8000:8000"
restart: on-failure
# networks:
# - egov-network
volumes:
- ${HOME}/workspace:/usr/app/msa-attach-volume
environment:
SPRING_CLOUD_CONFIG_URI: "egov-config:8888"
SPRING_CLOUD_CONFIG_URI: http://config:8888
SPRING_PROFILES_ACTIVE: default
EUREKA_INSTANCE_HOSTNAME: discovery
TZ: Asia/Seoul
depends_on:
- egov-config
# links:
# - egov-config
# healthcheck:
# test: ["CMD", "curl", "-f", "egov-config:8888"]
- config
rabbitmq:
container_name: rabbitmq
@@ -55,8 +46,6 @@ services:
- "5672:5672"
- "15672:15672"
restart: always
# networks:
# - egov-network
environment:
TZ: Asia/Seoul
@@ -66,12 +55,10 @@ services:
ports:
- "8085:9411"
restart: always
# networks:
# - egov-network
environment:
TZ: Asia/Seoul
networks:
default:
external: true
name: egov-network
external:
name: egov-network