A review of stacks and other Docker Swarm resources
Docker Swarm allows us to deploy applications with multiple services by running stacks. This new object defines, in a Compose YAML file, the structure, components, communications, and interactions with external resources of your applications. Therefore, we will use infrastructure as code (IaC) to deploy our applications on top of the Docker Swarm orchestrator.
Important note
Although we use a Compose YAML file, not all the docker-compose
keys are available. For example, the depends_on
key is not available for stacks because they don’t include any dependency declarations. That’s why it is so important to prepare your application’s logic in your code. Health checks will let you decide how to break some circuits when some components fail, but you should include status verifications on dependent components when, for example, they need some time to start. Docker Compose runs applications’ containers on...