Initialize a Docker Swarm
bash
for i in 1 2 3; dodocker-machine create -d virtualbox node-$idoneeval $(docker-machine env node-1)docker swarm init --advertise-addr $(docker-machine ip node-1)TOKEN=$(docker swarm join-token -q worker)for i in 2 3; doeval $(docker-machine env node-$i)docker swarm join --token $TOKEN --advertise-addr $(docker-machine ip node-$i) $(docker-machine ip node-1):2377doneeval $(docker-machine env node-1)docker node ls
bash
for i in 1 2 3; dodocker-machine create -d virtualbox node-$idoneeval $(docker-machine env node-1)docker swarm init --advertise-addr $(docker-machine ip node-1)TOKEN=$(docker swarm join-token -q worker)for i in 2 3; doeval $(docker-machine env node-$i)docker swarm join --token $TOKEN --advertise-addr $(docker-machine ip node-$i) $(docker-machine ip node-1):2377doneeval $(docker-machine env node-1)docker node ls
Scaling Service
bash
# Run docker commands in the manager nodeeval $(docker-machine env node-1)docker service scale <serviceName>=5
bash
# Run docker commands in the manager nodeeval $(docker-machine env node-1)docker service scale <serviceName>=5
Creating Proxy
bash
docker service create --name proxy -p 80:80 -p 443:443 -p 8080:8080 --network proxy -e MODE=swarm vfarcic/docker-flow-proxy
bash
docker service create --name proxy -p 80:80 -p 443:443 -p 8080:8080 --network proxy -e MODE=swarm vfarcic/docker-flow-proxy