From 6e9e985e27bf56d27ee8d05131345c45d07f397d Mon Sep 17 00:00:00 2001 From: kimjaeyeol Date: Tue, 26 Oct 2021 18:30:43 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20docker=20compose=20service=20nam?= =?UTF-8?q?e=20=EC=97=90=20'-'=20=EB=93=A4=EC=96=B4=EA=B0=80=EB=A9=B4=20?= =?UTF-8?q?=EB=82=B4=EB=B6=80=20=ED=86=B5=EC=8B=A0=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- config/application.yml | 2 +- docker-compose/app/mesh/docker-compose.yml | 41 +++++++------------ 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/backend/discovery/src/main/resources/application.yml b/backend/discovery/src/main/resources/application.yml index 9312ccc..aa92c9d 100644 --- a/backend/discovery/src/main/resources/application.yml +++ b/backend/discovery/src/main/resources/application.yml @@ -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 \ No newline at end of file diff --git a/config/application.yml b/config/application.yml index ba4b8ad..af563ea 100644 --- a/config/application.yml +++ b/config/application.yml @@ -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: diff --git a/docker-compose/app/mesh/docker-compose.yml b/docker-compose/app/mesh/docker-compose.yml index e555fda..7799582 100644 --- a/docker-compose/app/mesh/docker-compose.yml +++ b/docker-compose/app/mesh/docker-compose.yml @@ -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 \ No newline at end of file + external: + name: egov-network \ No newline at end of file