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 port 8080 to the end and start using the microservice with the awareness that all dependencies are properly installed to be more flexible and that it allows us to handle our application much better.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.29.139