Deploying stacks to Docker swarm
Stacks in Docker swarm address the limitations of using Docker Compose with a single host. You create a stack from a Compose file, and Docker stores all the metadata for the stack's services in the swarm. This means Docker is aware that the set of resources represents one application, and you can manage services from any Docker client without needing the Compose file.
You can also make use of Docker secrets to make sensitive data available to service containers instead of using environment variables.
Docker secrets
Swarm mode is inherently secure--communication between all the nodes is encrypted, and the swarm provides an encrypted data store that is distributed among the manager nodes. You can use this store for application secrets, which are a first-class resource in the Docker swarm.
Secrets are created with a name and the contents of the secret, which can be read from a file or entered into the command-line. In the ch07-docker-stack
folder, I have a folder...