Using the containers

We already have our containers declared; the time has come to use them. For this, it is necessary to have installed Docker, the docker-machine, and the docker-compose.

With Docker running as a service, we will use the docker-machine to create our host:

$ docker-machine create dev

With our host created, let's map the docker-machine URL host generated:

$ eval "$(docker-machine env dev)"

Now, let's use the docker-compose to create the containers and initialize them:

$ docker-compose up -d -build

After a few minutes, all containers will be ready for use. We need to know only when the Docker is running our application. For this, we will execute the following command:

$ docker-machine ip dev

With the IP passed, simply add the ...

Get Microservice Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.