I have a spring cloud config server and packaged it as a docker image then I have spring cloud eureka server which is also packaged as docker image.
When I run the two using docker compose I get the following error.
discovery-service_1 | 2017-06-24 15:36:12.059 INFO 5 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://config-service:9001
discovery-service_1 | 2017-06-24 15:36:12.997 WARN 5 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://config-service:9001/cls-discovery-service/default": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
Although the config service is up and running successfully, discover service still does not find it for some reason.
Docker compose file being used here is this
version: '2'
services:
config-service:
image: cloudsea/cls-config-service
ports:
- 9001:9001
expose:
- "9001"
discovery-service:
image: cloudsea/cls-discovery-service
depends_on:
- config-service
environment:
CLOUD_SEA_CONFIG_SERVER_URI: http://config-service:9001
EUREKA_DEFAULT_ZONE_URL: http://discovery-service:8761/eureka/
ports:
- 8761:8761
links:
- config-service:config-service
Below is the bootstrap.properties for DISCOVERY SERVICE
spring.cloud.config.uri = ${CLOUD_SEA_CONFIG_SERVER_URI:http://localhost:9001}
spring.application.name = ${SPRING_APPLICATION_NAME:cls-discovery-service}
Below is the cls-discovery-service.properties for DISCOVERY SERVICE located in github.
server.port=${SERVER_PORT:8761}
eureka.client.registerWithEureka: false
eureka.client.fetchRegistry: false
eureka.client.serviceUrl.defaultZone: ${EUREKA_DEFAULT_ZONE_URL:http://localhost:8761/eureka/}
eureka.server.eviction-interval-timer-in-ms: 1000
I am assuming something is wrong with my docker-compose.yml but I am not sure.
Any help will I am stick in this for hours ... heading close to days :(