Add docker-compose.yml

This commit is contained in:
2025-11-18 17:31:09 +00:00
commit 5059211574

45
docker-compose.yml Normal file
View File

@@ -0,0 +1,45 @@
version: "3.8"
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=15d"
- "--web.enable-lifecycle"
ports:
- "9090:9090"
networks:
- monitoring
restart: unless-stopped
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
# optional but handy
- GF_SERVER_DOMAIN=localhost
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/
volumes:
- grafana_data:/var/lib/grafana
ports:
- "3000:3000"
networks:
- monitoring
depends_on:
- prometheus
restart: unless-stopped
networks:
monitoring:
volumes:
prometheus_data:
grafana_data: