This repository is the home of my Cloud Stack. My personal website and all the cloud based tools that I use in my daily job.
All the Tools are installed on a Ubuntu VM as Docker Containers.
I use Terraform to deploy the VM (and all the other Infrastructure resources) into an Azure Subscription and Docker Compose to run the services.
A Traefik Proxy (configured automatically thanks the Docker Config Discoovery) is used asa reverse proxy. TODO: continue doc
Or:
Go into the infrastructure folder
cd infrastructure
Open (or create) the local.auto.tfvars
file and set all variables
subscription_id = ""
client_id = ""
client_secret = ""
tenant_id = ""
username = "" # the VM user name
environment = "" # will be used as a tag in azure
name = "" # will be used as a ResourceGroup name or as prefix for net, nsg, etc.
Deploy the infrastructure with Terraform
terraform apply
Set some Variables needed for the next steps
VM_IP_ADDRESS=ip_address
VM_USER_NAME=user_name
HOST_NAME=vm_name
Create a docker-machine with a generic driver with the new created IP
docker-machine create \
--driver generic \
--generic-ip-address=$VM_IP_ADDRESS \
--generic-ssh-user $VM_USER_NAME \
--generic-ssh-key ~/.ssh/id_rsa \
$HOST_NAME
Switch to the new created machine
eval $(docker-machine env $HOST_NAME)
Init docker swarm and create an overlay network
docker swarm init
docker network create -d overlay --attachable main-net
Switch back to your local Docker
eval "$(docker-machine env -u)"
Configure now your DNS to point to the new created VM
Follow the next steps here:
- setup the proxy
- setup the monitoring