57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
services:
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- 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.time=200h'
|
|
- '--web.enable-lifecycle'
|
|
networks:
|
|
- grafana_network
|
|
|
|
grafana:
|
|
image: grafana/grafana:12.0.2
|
|
container_name: grafana
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- GF_AUTH_ANONYMOUS_ENABLED=true
|
|
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
|
|
- GF_AUTH_DISABLE_LOGIN_FORM=true
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./grafana/provisioning:/etc/grafana/provisioning
|
|
depends_on:
|
|
- prometheus
|
|
networks:
|
|
- grafana_network
|
|
|
|
# Example microservice with metrics endpoint
|
|
metrics_generator:
|
|
image: prom/node-exporter:latest
|
|
container_name: example_metrics
|
|
ports:
|
|
- "9100:9100"
|
|
networks:
|
|
- grafana_network
|
|
|
|
volumes:
|
|
grafana_data:
|
|
driver: local
|
|
prometheus_data:
|
|
driver: local
|
|
|
|
networks:
|
|
grafana_network:
|
|
driver: bridge
|
|
|