Hi,
I have the below scenario and love to know any solution using docker-compose, and not in swarm mode yet.
I want to svc1 and svc2 be able to talk with each other through bridge network, and also using host network. I know you cannot have both networks and network_mode in docker-compose.
The use case is Kibana needs to talk with Elasticsearch, on the same host. Or, can I have Kibaba bind to an IP on host and Elasticsearch bind to another IP on the host. Can I accomplish it. Or, what’s the best way to address it.
You can do this with the standard networking setup. Docker Compose will create a network for you. Docker then provides an internal DNS service to your containers. If you have a single container labeled as elasticsearch: in the docker-compose.yml file, then Kibana can connect to http://elasticsearch:9200/. On the flip side, whatever you specify under ports: will be visible from the outside, so you can publish Kibana, and if you’d like also publish Elasticsearch.
You will have trouble accessing the ES server directly from outside the current physical host; most clients have an option to ignore the set of servers ES returns in its initial bootstrap. Clustering ES here is also a little tricky. But for a single node this recipe should work.