Project that set up ready to launch Docker Swarm orchestration
Also this project provides:
- Best practice Dockerfile
- Production grade docker compose file
- Visualizer Docker Swarm nodes
Maybe later will add:
- Secret in Docker Swarm
- Overriding docker compose file
IP Address | Hostname VM | Role in Docker Swarm |
---|---|---|
192.168.1.20/24 | swarm-orchestra-101-node1 | Manager |
192.168.1.21/24 | swarm-orchestra-101-node2 | Worker |
192.168.1.22/24 | swarm-orchestra-101-node3 | Worker |
At ansible folder, run this command:
ansible-playbook -i <current_ip_vm>, set-static-ip.yaml -K -e "ip=<desired_static_ip>" -e "gateway=<gateway>" -e "hostname=<hostname_vm>"
At ansible folder, run this command:
ansible-playbook -i inventory.ini set-up-docker-swarm.yaml -K
At /app on swarm-orchestra-101-node1 VM, run this command:
docker stack deploy -d -c docker-compose.production.yml swarm-orchestra-101
On swarm-orchestra-101-node1, run this command:
docker stack services swarm-orchestra-101
docker service ps swarm-orchestra-101_backend
docker service logs swarm-orchestra-101_db-migration
On browser access swarm-orchestra-101-node1 using its IP through port 8080 (http://192.168.1.20:8080)
This demo will shows that docker overlay network (docker swarm network default) have ability to distribute load (request) service to their container replicas even running on different nodes (VM)