-
-
Save dhiren051/1b90b4cf5c84dd6d0e171e1b9bfa11d7 to your computer and use it in GitHub Desktop.
Docker Compose to Prometheus, PushGateway and Grafana setup
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.1' | |
networks: | |
monitor-net: | |
driver: bridge | |
volumes: | |
prometheus_data: {} | |
grafana_data: {} | |
services: | |
prometheus: | |
image: prom/prometheus:v2.1.0 | |
container_name: prometheus | |
volumes: | |
- ./prometheus/:/etc/prometheus/ | |
- prometheus_data:/prometheus | |
command: | |
- '--config.file=/etc/prometheus/prometheus.yml' | |
- '--storage.tsdb.path=/prometheus' | |
- '--web.console.libraries=/etc/prometheus/console_libraries' | |
- '--web.console.templates=/etc/prometheus/consoles' | |
- '--storage.tsdb.retention=200h' | |
- '--web.enable-lifecycle' | |
# restart: unless-stopped | |
expose: | |
- 9090 | |
networks: | |
- monitor-net | |
labels: | |
org.label-schema.group: "monitoring" | |
alertmanager: | |
image: prom/alertmanager:v0.13.0 | |
container_name: alertmanager | |
volumes: | |
- ./alertmanager/:/etc/alertmanager/ | |
command: | |
- '--config.file=/etc/alertmanager/config.yml' | |
- '--storage.path=/alertmanager' | |
restart: unless-stopped | |
expose: | |
- 9093 | |
networks: | |
- monitor-net | |
labels: | |
org.label-schema.group: "monitoring" | |
pushgateway: | |
image: prom/pushgateway | |
container_name: pushgateway | |
restart: unless-stopped | |
expose: | |
- 9091 | |
ports: | |
- "9091:9091" | |
networks: | |
- monitor-net | |
labels: | |
org.label-schema.group: "monitoring" | |
grafana: | |
image: grafana/grafana:4.6.3 | |
container_name: grafana | |
volumes: | |
- grafana_data:/var/lib/grafana | |
- ./grafana/datasources:/etc/grafana/datasources | |
- ./grafana/dashboards:/etc/grafana/dashboards | |
- ./grafana/setup.sh:/setup.sh | |
entrypoint: /setup.sh | |
environment: | |
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin} | |
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin} | |
- GF_USERS_ALLOW_SIGN_UP=false | |
restart: unless-stopped | |
expose: | |
- 3000 | |
networks: | |
- monitor-net | |
labels: | |
org.label-schema.group: "monitoring" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment