With this cluster you can deploy in your localhost or your cloud server a Docker Swarm to develop or you can test a Docker-based ecosystem of applications for you. It is not recommended to use for production environments.
- Knowledges: docker, docker-compose, swarm, DNS
- To have installed docker previously
We have to join in a cluster mode with next command in your machine:
docker swarm init
OPTIONAL: If you have more than 1 node, click here
git clone https://github.com/agosalvez/easy-devops.git
Local:
cd easy-devops/swarm/http
Cloud server:
cd easy-devops/swarm/https
- traefik.yml:14 => Set your own email for letsencrypt
Next script will create a pair of docker networks and deploy the traefik and portainer stacks:
Windows
./win/initCluster.bat
Unix
./unix/initCluster.sh
Modify portainer.yml:31 with your desired domain (your own domain if you are in a server)
# Add the following line (or your domain) to the end of the /etc/hosts file:
127.0.0.1 portainer.mylab.com
The domain have to be exactly in hosts file and portainer.yml:31
- Redirect you desired domain to your server public IP and configure right labels in portainer.yml:31
Go to http://portainer.mylab.com
Go to https://portainer.mylab.com (or your domain setted in portainer.yml) to try it!
After that, you can start and stop this cluster with these scripts:
Windows
./win/startCluster.bat
Unix
./unix/startCluster.sh
Windows
./win/stopCluster.bat
Unix
./unix/stopCluster.sh
- Main author: Adrián Gosálvez
- Collaborator: Javier Pérez