docer compose

This commit is contained in:
Michal 2024-08-18 02:57:01 +01:00
parent 141a2a63f7
commit cc549e2cc2
2 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,14 @@
Run docker compose to deploy prometheus, grafana, and edenic exporter
After that go to the prometheus container and add to the config file:
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'edenic-exporter'
metrics_path: '/metrics'
scrape_interval: 60s
static_configs:
- targets: ['edenic-exporter:5000']

56
docker-compose.yaml Normal file
View File

@ -0,0 +1,56 @@
version: '3.7'
volumes:
prometheus_data: {}
grafana_data: {}
etc_prometheus: {}
grafana_provisioning: {}
networks:
front-tier:
back-tier:
services:
prometheus:
image: prom/prometheus:v2.36.2
volumes:
- etc_prometheus:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- 9090:9090
networks:
- back-tier
restart: always
grafana:
image: grafana/grafana
user: "472"
depends_on:
- prometheus
ports:
- 3000:3000
volumes:
- grafana_data:/var/lib/grafana
- grafana_provisioning:/etc/grafana/provisioning/
environment:
GF_INSTALL_PLUGINS: fetzerch-sunandmoon-datasource
env_file:
- stack.env
networks:
- back-tier
- front-tier
restart: always
edenic-exporter:
image: michalzxc/edenic-exporter:latest
depends_on:
- prometheus
networks:
- back-tier
restart: always