This repo gives a few examples of patterns for how you might build Docker Swarm clusters with all the bells and whistles.
A Docker Swarm cluster needs more then just your app running, it often needs at least these additional services:
- Layer 7 Reverse Proxy (to host multiple HTTP sites on one port)
- Swarm-aware storage for data persistance
- Centralized logging of your app containers
- Centralized monitoring of nodes and containers
- Cluster management GUI
- Continuous deployment of updated images
This demo is meant for you to git clone
and run locally to help you learn the tools and methods for building a complete Docker Swarm cluster.
This repo holds two deployment examples for Docker Swarm
- Docker Swarm CE (Community Edition) open source stack
- Docker Swarm EE (Enterprise Edition) stack
The EE stack requires at least a trial license to deploy.
You can do all this locally on a single node or optionally using Docker Machine to multi-node clusters.
The scripts and compose/stack files use variables to make this demo easier to get started. Set these at your shell before running commands
TODO: add envs
Just have Docker installed, either via Docker for Windows/Mac or on Linux. See my YouTube videos on the proper way to setup your OS for Docker using downloads from store.docker.com.
Then just create a single-node Swarm in that engine:
docker swarm init
./create-servers.sh
gives example docker-machine commands for creating 3 nodes in various VM environments including locally with VirtualBox, Hyper-V, and in the cloud using Digital Ocean.
TODO