Created my first Docker app. A simple nodejs hello world web server to get started before I start work on the full app. Ran 17 copies of the web server in 1Gb of memory. The thing that impresses me the most how quick it is to start up additional copies. A second or so and you have another web server on another port. An hour well spent this evening.
I've started building a node.js CMS, mainly for the experience of doing it and I was planning to dockerise it. Might be asking you one or two questions if I come unstuck.
Key bits for you are
docker swarm init # just need once on each node ( server) - need version 1.12 and above
docker swarm join --token ... # once for each node (server) you wish to add
docker network create -d overlay cms-network # once on a management node in the swarm
docker service create --name web-cms --network cms-network --restart-condition on-failure --replicas 4 <image> # Once per service on just one of management nodes
docker service update --replicas 6 # manually scale service, update image used etc.
I can then refer to web-cms service by name , for example
http://web-cms within any container launched on the cms-network network. It will load balance across the number of replicas in a service and the replicas will be spread across the nodes (servers) in the swarm cluster. The service by default will bind to two networks, eth0 is your overlay network and eth1 is the gateway bridge network to your hosts. If you examine a service you'll find the VIP for it. The VIP survives across restarts / start / stops of a service. The VIP is just generally for anything communicating to a service inside docker from the outside either the overlay network or docker itself. Plus of course your Dockerfile for the image build will need to state which ports are exposed by the service you are building. There's also scaling command for auto scaling but you don't need those to get started.