mirror of
https://github.com/DullJZ/s3-balance.git
synced 2026-06-27 22:11:22 +08:00
88 lines
2.3 KiB
YAML
88 lines
2.3 KiB
YAML
services:
|
|
# S3 Balance 服务
|
|
s3-balance:
|
|
build:
|
|
context: ../..
|
|
dockerfile: deploy/docker/Dockerfile
|
|
container_name: s3-balance
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- ../docker/config.docker.yaml:/app/config/config.yaml
|
|
- ../docker/data:/app/data
|
|
environment:
|
|
- TZ=Asia/Shanghai
|
|
networks:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
command: ["/app/s3-balance", "-config", "/app/config/config.yaml"]
|
|
|
|
# Prometheus 监控
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ../monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- ../monitoring/s3_balance_alerts.yml:/etc/prometheus/s3_balance_alerts.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:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
|
|
# Grafana 可视化
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: grafana
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ../monitoring/grafana/provisioning:/etc/grafana/provisioning
|
|
- ../monitoring/grafana/dashboards:/var/lib/grafana/dashboards
|
|
environment:
|
|
- GF_SECURITY_ADMIN_USER=admin
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin123
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
|
|
networks:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- prometheus
|
|
|
|
# Node Exporter (可选,监控宿主机)
|
|
node-exporter:
|
|
image: prom/node-exporter:latest
|
|
container_name: node-exporter
|
|
ports:
|
|
- "9100:9100"
|
|
volumes:
|
|
- /proc:/host/proc:ro
|
|
- /sys:/host/sys:ro
|
|
- /:/rootfs:ro
|
|
command:
|
|
- '--path.procfs=/host/proc'
|
|
- '--path.sysfs=/host/sys'
|
|
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
|
networks:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
prometheus_data:
|
|
driver: local
|
|
grafana_data:
|
|
driver: local
|
|
|
|
networks:
|
|
monitoring:
|
|
driver: bridge |