-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
The Docker Workshop
By :
Docker Compose runs and manages multi-container applications defined in docker-compose.yaml files. Although the containers are designed as independent microservices, creating services that depend on each other is highly expected. For instance, let's assume you have a two-tier application with database and backend components, such as a PostgreSQL database and a Java backend. The Java backend component requires PostgreSQL to be up and running since it should connect to the database to run the business logic. Therefore, you could need to define the dependency between the services of the multi-container applications. With Docker Compose, it is possible to control the order of the startup and shutdown of the services.
Say you have a three-container application with the following docker-compose.yaml file:
version: "3" services: init: image: busybox pre: image: busybox &...