Docker compose a VM to get LetsEncrypt / NGINX proxy auto provisioning, ELK logging, Prometheus / Grafana monitoring, Portainer GUI, and more...
Starting point for turning a single VM into a containerized cloud development suite or lightweight container hosting environment. You can also just take the bones and basically do whatever you want with it.
Deploy any number of docker containers to almost any flavor Linux VM, as long as it supports docker
and docker-compose
your golden (although some may prove more difficult than others). Currently this repo is being developed on a Ubuntu 18.04 LTS Minimal VM on GCE (n1-standard-2).
All the monthly fees for git, logging, monitoring, error monitoring, alerting, CI, etc etc really start to add up don't they... Well cancel a bunch of monthly fees with me, plus you don't even need to spend 100s of hours debugging to get it all working.
That is the goal anyways, its all containerized so add or subtract as you see fit.
Unfortunatly this setup with the SSL provisioning is not localhost friendly, also I am not actively supporting installing or running this on anything except a linux VM or if you are slick and run linux as your everyday OS you can get it working locally pretty easily. If you want to try it on Windows be my guest but I bet it won't be fun.
On your host VM install docker
and docker-compose
, if you can't get this going probably this stack is not what your looking for anyways.
On the host make sure /etc/sysctl.conf has vm.max_map_count set to at least 262144 - vm.max_map_count=262144
Point all the subdomains you will be using to the public IP of your host VM, these are examples of what you may want to use.
find -type f -name "*-compose.yml" | xargs sed -i "s/example.com/yourdomain.com/g"
find -type f -name "*-compose.yml" | xargs sed -i "s/[email protected]/[email protected]/g"
docker-compose -f proxy-compose.yml up -d
docker-compose -f logging-compose.yml up -d
** Optional ** Setup basic auth for kibana
sudo sh -c "echo -n '[username]:' >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/kibana.example.com"
sudo sh -c "openssl passwd -apr1 >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/kibana.example.com"
docker-compose -f monitoring-compose.yml up -d
** Optional ** Setup basic auth for cadvisor, alertmanager, and prometheus
sudo sh -c "echo -n '[username]:' >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/cadvisor.example.com"
sudo sh -c "openssl passwd -apr1 >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/cadvisor.example.com"
sudo sh -c "echo -n '[username]:' >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/alertmanager.example.com"
sudo sh -c "openssl passwd -apr1 >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/alertmanager.example.com"
sudo sh -c "echo -n '[username]:' >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/prometheus.example.com"
sudo sh -c "openssl passwd -apr1 >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/prometheus.example.com"
docker-compose -f gui-compose.yml up -d
echo -e "\nSENTRY_SECRET_KEY=$(docker-compose run --rm sentry-base sentry config generate-secret-key)" >> sentry/sentry.env
docker-compose -f sentry-compose.yml run --rm sentry-base sentry upgrade
docker-compose -f sentry-compose.yml up -d
** To Upgrade **
Use the following steps after updating sentry Dockerfile:
docker-compose -f sentry-compose.yml run --rm sentry-web upgrade
docker-compose -f sentry-compose.yml up -d
sudo sh -c "echo -n '[username]:' >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/${VIRTUAL_HOST}"
sudo sh -c "openssl passwd -apr1 >> /var/lib/docker/volumes/dockerize-your-dev_htpasswd/_data/${VIRTUAL_HOST}"
https://github.com/jwilder/nginx-proxy
https://github.com/buchdag/letsencrypt-nginx-proxy-companion-compose
https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion