From 797fe556a4e23291f4f2ded9bb01596462f860a0 Mon Sep 17 00:00:00 2001 From: bivashy Date: Mon, 1 Sep 2025 19:22:03 +0500 Subject: [PATCH] Use eureka client with shared docker network --- .env.example | 3 +++ compose.yml | 7 ++++--- pom.xml | 6 ++++++ src/main/resources/application.properties | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..368f33c --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +KODIK_TOKEN=YOUR_KODIK_TOKEN +EUREKA_SCHEMA=http +EUREKA_HOST=anyame-vue-bff:8080 diff --git a/compose.yml b/compose.yml index b9efa05..a66601d 100644 --- a/compose.yml +++ b/compose.yml @@ -5,7 +5,8 @@ services: - 8081:8080 env_file: .env networks: - - anyame + - anyame-shared + networks: - anyame: - driver: bridge + anyame-shared: + external: true diff --git a/pom.xml b/pom.xml index 3cc4e2f..ede7bdb 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,7 @@ 1.20.1 4.0.0 2.8.9 + 4.3.0 @@ -66,6 +67,11 @@ springdoc-openapi-starter-webmvc-ui ${springdoc-openapi-starter.version} + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + ${spring-eureka-client.version} + org.springframework.boot diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 1f0c7d0..6807d1d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,2 +1,4 @@ spring.application.name=anyame-kodik-extractor-backend kodik.token=${KODIK_TOKEN} +eureka.client.serviceUrl.defaultZone: ${EUREKA_SCHEMA}://${EUREKA_HOST}/eureka/ +