Learning Software System

Docker-Compose made Easy with Elasticsearch and Kibana

Up and down a software system easily with docker-compose

Elye
Level Up Coding
Published in
5 min readFeb 19, 2021

--

Photo by Federico Beccari on Unsplash

Having a temporary setup on our computer to test a service locally has been made easy with Docker. We can set it up and tear it down any time.

We can have a Linux or Ubuntu or any OS system, and have any database or Software running on it, and serve what we need, without polluting our actual machine environment. That’s the power of Docker, as shared below.

But if there’s multiple local service (docker container) that we are running, and we need them to communicate, how is that possible?

The more complex docker setup

Yes, it is possible to set up to allow the services to communicate with one another. To demonstrate that, I’m going to set up an Elasticsearch service and connect it to Kibana (the console that can communicate with Elasticsearch).

Setting up the docker network

For the 2 services (containers) to communicate with each other, although they expose their port externally to our local machine, the containers don’t communicate through our local machine exposed port.

Instead, we need to build an internal network (which I name as docker network) bridge to allow them to intercommunicate.

To do that, we just need to type the command below, where es-net is the name I provide.

docker network create es-net --driver=bridge

The --driver=bridge is to show that we are using the bridge network available as the driver, it’s optional as it’s the default.

To view the network, just type docker network ls, and we’ll get something as below

NETWORK ID NAME DRIVER SCOPE
acd9ccf2f539 bridge bridge local
f14ca1c8849e es-net bridge local
6840debcb248 host host local
f514cb30a663 none null…

--

--