🐛 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 register-with-eureka: false
fetch-registry: false fetch-registry: false
service-url: 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: server:
peer-node-read-timeout-ms: 10000 peer-node-read-timeout-ms: 10000

View File

@@ -12,7 +12,7 @@ eureka:
register-with-eureka: true # eureka 서버에 등록 register-with-eureka: true # eureka 서버에 등록
fetch-registry: true # 외부 검색 가능 fetch-registry: true # 외부 검색 가능
service-url: 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 attach location - messages{lang}.properties 도 이 경로에 위치한다.
file: file:

View File

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