- Haproxy
- Proxy setup
- nginx
- Proxy setup
- Dockerfile
- Install the npm
- Deploy the Stack by specifying the stack file and name of our stack
# docker swarm init --advertise-addr <IP-Address>
# docker stack deploy -c docker-stack.yml node
#### OutPut
Creating network node_nodenet
Creating service node_proxy
Creating service node_app
# docker stack ps node
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
lyxcfgstvtd1 node_app.1 shariftest/testswarm:04 localhost.localdomain Running Running 40 seconds ago
ywxbm3m1o1dk node_proxy.1 dockercloud/haproxy:latest localhost.localdomain Running Running 42 seconds ago
o89n77szaehv node_app.2 shariftest/testswarm:04 localhost.localdomain Running Running 40 seconds ago
utpw6giks83n node_app.3 shariftest/testswarm:04 localhost.localdomain Running Running 40 seconds ago
Scale our Application down to 5 replica's
# docker service scale node-app=5
Remove the Stack:
#docker stack rm node
Removing service node_proxy
Removing service node_app
Removing network node_nodenet
Create the Stack: Deploy the Stack by specifying the stack file and name of our stack
# docker swarm init --advertise-addr <IP-Address>
# docker stack deploy -c docker-stack.yml node
Creating network node_nodenet
Creating service node_proxy
Creating service node_app
# docker stack ps node
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
1qxrg2hazypi node_proxy.1 nginx:latest localhost.localdomain Running Preparing 12 seconds ago
wsqwy8ti7ksm node_app.1 shariftest/testswarm:04 localhost.localdomain Running Running 13 seconds ago
- Scale our Application down to 5 replica's
# docker service scale node-app=5
# docker stack rm node
Removing service node_proxy
Removing service node_app
Removing network node_nodenet