March 2020
Beginner
592 pages
14h 14m
English
In Chapter 11, Docker Compose, we used an application consisting of two services that were declaratively described in a Docker compose file. We can use this compose file as a template to create a stack file that allows us to deploy the same application into a Swarm. The content of our stack file, called pet-stack.yaml, looks like this:
version: "3.7"services: web: image: fundamentalsofdocker/ch11-web:2.0 networks: - pets-net ports: - 3000:3000 deploy: replicas: 3 db: image: fundamentalsofdocker/ch11-db:2.0 networks: - pets-net volumes: - pets-data:/var/lib/postgresql/datavolumes: pets-data:networks: pets-net: driver: overlay
We request that the web service has three replicas, and both services are attached ...
Read now
Unlock full access