Starting and stopping services

We will discuss the life cycle of containers and how Compose helps in stopping and starting particular services.

Life cycle of containers

A common thing we will need to do while developing our application is to stop or start the various services that make it up. In a moment, we will dive into the fine-grained control Compose gives us to do this. Before we do, though, it is helpful to have in mind the journey that containers go through from creation until they are no longer needed. The following figure shows a simplified version of a container’s life cycle:

Get hands-on with 1400+ tech skills courses.