I have this sample docker-compose.yml:
version: "2"
networks:
default:
external:
name: simple-monitor_zeebe_network
services:
ods:
container_name: auto-auction-service
image: cargeeks/auto-auction-service:SNAPSHOT
environment:
- SERVICE_LOG_LEVEL=debug
- client.broker.contactPoint=172.20.0.6:26500
ports:
- "9200:7100"
networks:
- default
Somewhere in my microservice, I have code like this which attempts to resolve the client.broker.contactPoint environment variable.
String contactPoint = System.getenv("client.broker.contactPoint");
if (StringUtils.isEmpty(contactPoint)) {
_logger.info("Environment variable " + ENV_CONTACT_POINT + " is not defined. Using default " + DEFAULT_CONTACT_POINT);
contactPoint = DEFAULT_CONTACT_POINT;
}
When I run docker-compose up against the docker-compose.yml file defined above, the contactPoint is always defined to the DEFAULT_CONTACT_POINT.
What am I doing wrong here?