I use docker compose to run all my micro services. For each service I give it a short hostname.
version: '2'
services:
config:
image: springbox-config-server
restart: always
ports:
- "8890:8890"
discovery:
image: springbox-eureka
restart: always
ports:
- "8763:8763"
Therefore, in my micro service I have to target the configserver with its short hostname.
spring:
application:
name: myservice
cloud:
config:
uri: http://config:8890
fail-fast: true
However, when I run them locally in my IDE without docker, the short hostname can't be resolved.
So I'm looking for a solution to target different config server according to my environment.