Acid Swarm is a docker stack to get your Docker Swarm cluster ready in minutes.
This compose file was created to be deployed inside a Docker Swarm Cluster. For more info on how to create one check the Docker Documentation.
You could also use our Terraform template to deploy a Docker Swarm cluster to AWS.
To monitorize the Docker Swarm cluster we use Swarmpit, it allows us to see in which nodes the applications are deployed, check the logs for each application and the resources used by each node. It also give us some more functionality, like deploy stacks, add an image registry and manage docker secrets.
Once the stack is deployed, you can access it in swarmpit.yourdomain.com
.
To redirect the traffic to the correct container we use Traefik. With Traefik you can configure a set of rules to determine what petition goes to what container. This is configured directly in the docker-compose files and it continously updates it's configuration so restarts are not needed.
Once the stack is deployed, you can check those rules in traefik.yourdomain.com
.
We also add a container with a restart policy of 24h
which cleans up unused images and containers every 24 hours.
All the following commands must be executed in a manager node
.
First, we will create the overlay network that Traefik
will use to distribute the load across the entire cluster. We are naming this network traefik-net
,
but feel free to give it the name you want. Just remember to change the name in the docker-compose file too.
docker network create -d overlay traefik-net
Then clone this repository
git clone https://github.com/acidtango/acid_swarm.git
and deploy the stack specifying the domain to use for Traefik rules.
DOMAIN_NAME={your-domain} docker stack deploy -c swarm_init/docker-compose.yml infrastructure
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.