Created
August 13, 2019 19:00
-
-
Save jonpugh/9653a2c5a3e85fb1e73c64dcedef6973 to your computer and use it in GitHub Desktop.
Grafana/Graphite/Icinga/StatsD/Rancher/Prometheus Stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "2" | |
| volumes: | |
| grafana-data: | |
| prometheus-data: | |
| graphite-data: | |
| services: | |
| nginx: | |
| restart: always | |
| image: nginx | |
| container_name: nginx | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: | |
| - "./volumes/proxy/conf.d:/etc/nginx/conf.d" | |
| - "/etc/nginx/vhost.d" | |
| - "/usr/share/nginx/html" | |
| - "./volumes/proxy/certs:/etc/nginx/certs:ro" | |
| nginx-gen: | |
| restart: always | |
| image: jwilder/docker-gen | |
| container_name: nginx-gen | |
| volumes: | |
| - "/var/run/docker.sock:/tmp/docker.sock:ro" | |
| - "./volumes/proxy/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro" | |
| volumes_from: | |
| - nginx | |
| entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf | |
| environment: | |
| - DEFAULT_HOST=dashboard.devshop.cloud | |
| letsencrypt-nginx-proxy-companion: | |
| restart: always | |
| image: jrcs/letsencrypt-nginx-proxy-companion | |
| container_name: letsencrypt-nginx-proxy-companion | |
| volumes_from: | |
| - nginx | |
| volumes: | |
| - "/var/run/docker.sock:/var/run/docker.sock:ro" | |
| - "./volumes/proxy/certs:/etc/nginx/certs:rw" | |
| environment: | |
| - NGINX_DOCKER_GEN_CONTAINER=nginx-gen | |
| rancher: | |
| image: rancher/server | |
| ports: | |
| - "8080" | |
| environment: | |
| - VIRTUAL_HOST=rancher.devshop.cloud | |
| - VIRTUAL_NETWORK=nginx-proxy | |
| - VIRTUAL_PORT=8080 | |
| - LETSENCRYPT_HOST=rancher.devshop.cloud | |
| - [email protected] | |
| cadvisor: | |
| labels: | |
| io.rancher.scheduler.global: 'true' | |
| tty: true | |
| image: google/cadvisor:latest | |
| stdin_open: true | |
| volumes: | |
| - "/:/rootfs:ro" | |
| - "/var/run:/var/run:rw" | |
| - "/sys:/sys:ro" | |
| - "/var/lib/docker/:/var/lib/docker:ro" | |
| node-exporter: | |
| labels: | |
| io.rancher.scheduler.global: 'true' | |
| tty: true | |
| image: prom/node-exporter:latest | |
| stdin_open: true | |
| prom-conf: | |
| tty: true | |
| image: infinityworks/prom-conf:20 | |
| volumes: | |
| - /etc/prom-conf/ | |
| network_mode: none | |
| prometheus: | |
| tty: true | |
| image: prom/prometheus:v2.1.0 | |
| command: --config.file=/etc/prom-conf/prometheus.yml --storage.tsdb.path=/prometheus --web.console.libraries=/etc/prometheus/console_libraries --web.console.templates=/etc/prometheus/consoles | |
| ports: | |
| - "9090" | |
| labels: | |
| io.rancher.sidekicks: prom-conf | |
| volumes_from: | |
| - prom-conf | |
| volumes: | |
| - prometheus-data:/prometheus | |
| volume_driver: ${VOLUME_DRIVER} | |
| links: | |
| - cadvisor:cadvisor | |
| - node-exporter:node-exporter | |
| - prometheus-rancher-exporter:prometheus-rancher-exporter | |
| extra_hosts: | |
| - "rancher-server:${RANCHER_SERVER}" | |
| environment: | |
| - VIRTUAL_HOST=prometheus.devshop.cloud | |
| - VIRTUAL_NETWORK=nginx-proxy | |
| - VIRTUAL_PORT=9090 | |
| - LETSENCRYPT_HOST=prometheus.devshop.cloud | |
| - [email protected] | |
| graf-db: | |
| tty: true | |
| image: infinityworks/graf-db:11 | |
| command: cat | |
| volumes: | |
| - grafana-data:/var/lib/grafana/ | |
| volume_driver: ${VOLUME_DRIVER} | |
| network_mode: none | |
| grafana: | |
| tty: true | |
| image: grafana/grafana:5.3.4 | |
| ports: | |
| - "3000" | |
| volumes: | |
| - ./volumes/var/lib/grafana:/var/lib/grafana | |
| labels: | |
| io.rancher.sidekicks: graf-db | |
| # volumes_from: | |
| # - graf-db | |
| env_file: | |
| - secrets_grafana.env | |
| links: | |
| - prometheus:prometheus | |
| - prometheus-rancher-exporter:prometheus-rancher-exporter | |
| - graphite:graphite | |
| environment: | |
| - VIRTUAL_HOST=grafana.devshop.cloud | |
| - VIRTUAL_NETWORK=nginx-proxy | |
| - VIRTUAL_PORT=3000 | |
| - LETSENCRYPT_HOST=grafana.devshop.cloud | |
| - [email protected] | |
| - GF_SERVER_ROOT_URL=https://grafana.devshop.cloud | |
| - GF_SERVER_DOMAIN=grafana.devshop.cloud | |
| - GF_AUTH_ANONYMOUS_ENABLED=true | |
| - GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer | |
| - GF_AUTH_ANONYMOUS_ORG_NAME=DevShop.Cloud | |
| - GF_USERS_ALLOW_ORG_CREATE=true | |
| - GF_AUTH_GITHUB_ENABLED=true | |
| - GF_AUTH_GITHUB_SCOPES=user:email,read:org | |
| - GF_AUTH_GITHUB_AUTH_URL=https://github.com/login/oauth/authorize | |
| - GF_AUTH_GITHUB_TOKEN_URL=https://github.com/login/oauth/access_token | |
| - GF_AUTH_GITHUB_ALLOW_SIGN_UP=true | |
| - GF_AUTH_GITHUB_ALLOWED_ORGANIZATIONS=DevShopSupport | |
| - GF_AUTH_GITHUB_API_URL=https://api.github.com/user | |
| prometheus-rancher-exporter: | |
| tty: true | |
| labels: | |
| io.rancher.container.create_agent: true | |
| io.rancher.container.agent.role: environment | |
| image: infinityworks/prometheus-rancher-exporter:v0.22.52 | |
| environment: | |
| CATTLE_URL: https://rancher.devshop.cloud | |
| graphite: | |
| ports: | |
| - "80" | |
| - 8125:8125/udp | |
| - 8126:8126/tcp | |
| labels: | |
| io.rancher.container.pull_image: always | |
| io.rancher.scheduler.affinity:host_label: monitoring=true | |
| tty: true | |
| image: hopsoft/graphite-statsd:v0.9.15-phusion0.9.18 | |
| volumes: | |
| - graphite-data:/opt/graphite/storage | |
| stdin_open: true | |
| environment: | |
| VIRTUAL_HOST: statsd.devshop.cloud | |
| LETSENCRYPT_HOST: statsd.devshop.cloud | |
| LETSENCRYPT_EMAIL: [email protected] | |
| icinga: | |
| image: jordan/icinga2:2.9.0 | |
| hostname: icinga.devshop.cloud | |
| env_file: | |
| - ./secrets_sql.env | |
| environment: | |
| - ICINGA2_FEATURE_GRAPHITE=1 | |
| - ICINGA2_FEATURE_GRAPHITE_HOST=graphite | |
| - ICINGA2_FEATURE_GRAPHITE_PORT=2003 | |
| - ICINGA2_FEATURE_GRAPHITE_URL=http://graphite | |
| - ICINGAWEB2_ADMIN_USER=admin | |
| - VIRTUAL_HOST=icinga.devshop.cloud | |
| - HTTPS_METHOD=noredirect | |
| - LETSENCRYPT_HOST=icinga.devshop.cloud | |
| - [email protected] | |
| volumes: | |
| - ./data/icinga/cache:/var/cache/icinga2 | |
| - ./data/icinga/certs:/etc/apache2/ssl | |
| - ./data/icinga/etc/icinga2:/etc/icinga2 | |
| - ./data/icinga/etc/icingaweb2:/etc/icingaweb2 | |
| - ./data/icinga/lib/icinga:/var/lib/icinga2 | |
| - ./data/icinga/lib/php/sessions:/var/lib/php/sessions | |
| - ./data/icinga/log/apache2:/var/log/apache2 | |
| - ./data/icinga/log/icinga2:/var/log/icinga2 | |
| - ./data/icinga/log/icingaweb2:/var/log/icingaweb2 | |
| - ./data/icinga/log/mysql:/var/log/mysql | |
| - ./data/icinga/spool:/var/spool/icinga2 | |
| # If you want to enable outbound e-mail, create the files | |
| # and configure to your corresponding mail setup. | |
| # See: https://github.com/jjethwa/icinga2#sending-notification-mails | |
| #- ./ssmtp/revaliases:/etc/ssmtp/revaliases:ro | |
| # - ./ssmtp/ssmtp.conf:/etc/ssmtp/ssmtp.conf:ro | |
| ports: | |
| - "80" | |
| - "443" | |
| - "5665:5665" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment