Mastering Docker Compose

Now that we have our services up and running, we need some more information to manage these services together, and more specifically, to control and monitor its state.

To look at a specific service, you just need its original name. In our case, there's only the service and database to choose from. Let's look at our service:

As I told you previously, the service will probably fail at first and then Docker will restart it before it finally becomes ready. We can see that in this log. If you want to see the logs of all of the services mixed together by date, you can just omit the service name.

Another important command to memorize is used to list the services that are running. This is the same as for Docker, but it only lists the ones from our configuration:

Finally, to stop and remove everything from our deployment, we can run docker-compose down. This will first stop the containers and then remove them completely. This ensures that we don't leave any garbage behind:

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

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