Skip to content
Docker Swarm (Orchestration Service by docker)

icon picker
Deploy a multi node application in docker swarm

Architecture of the application
image.png


This architecture will require 1 Mount Volume(for database), 2 Networks and 5 Stack services.

Steps:

First create the network
Frontend network
docker network create -d overlay front_end_ntw
Backend network
docker network create -d overlay back_end_ntw
Deploying the voting frontend app
docker service create --name vote -p 5000:80 --network front_end_ntw --replicas 5 dockersamples/examplevotingapp_vote:before
Deploying redis
docker service create --name redis --network front_end_ntw --replicas 5 redis:3.2
Deploying worker service
docker service create --name worker --network front_end_ntw --network back_end_ntw dockersamples/examplevotingapp_worker:latest
Deploying postgres database
docker service create --name db --network back_end_ntw --mount type=volume,source=db-data,target=/var/lib/postgresql/data postgres:9.4
Deploying result service
docker service create --name result --network back_end_ntw -p 5001:80 dockersamples/examplevotingapp_result:before

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.