63 lines
2.0 KiB
YAML
63 lines
2.0 KiB
YAML
# =============================================================================
|
|
# Kong Monitoring Stack - Prometheus + Grafana
|
|
# =============================================================================
|
|
# Usage:
|
|
# docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
|
|
# =============================================================================
|
|
|
|
services:
|
|
# ===========================================================================
|
|
# Prometheus - 指标收集
|
|
# ===========================================================================
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: rwa-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'
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus_data:/prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
restart: unless-stopped
|
|
networks:
|
|
- rwa-network
|
|
|
|
# ===========================================================================
|
|
# Grafana - 可视化仪表盘
|
|
# ===========================================================================
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: rwa-grafana
|
|
environment:
|
|
- GF_SECURITY_ADMIN_USER=admin
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin123
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
# 反向代理支持
|
|
- GF_SERVER_ROOT_URL=https://monitor.szaiai.com
|
|
- GF_SERVER_SERVE_FROM_SUB_PATH=false
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
|
ports:
|
|
- "3030:3000"
|
|
depends_on:
|
|
- prometheus
|
|
restart: unless-stopped
|
|
networks:
|
|
- rwa-network
|
|
|
|
volumes:
|
|
prometheus_data:
|
|
driver: local
|
|
grafana_data:
|
|
driver: local
|
|
|
|
networks:
|
|
rwa-network:
|
|
external: true
|
|
name: api-gateway_rwa-network
|