Files
crmdesk/deploy/docker/compose/compose-prometheus.yaml
2026-09-19 16:35:35 +08:00

35 lines
1.2 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Prometheus 指标采集(可观测性组件,关键字:prometheus 或组合关键字 obs
# 启动方式:./start.sh obs ... 或 docker compose --env-file .env -f compose/compose-prometheus.yaml up -d(在 deploy/docker 目录执行)
# 应用需暴露 /actuator/prometheus 端点才会采集到业务指标
services:
bytedesk-prometheus:
image: prom/prometheus:latest
container_name: prometheus-bytedesk
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=15d'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- '19090:9090'
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
networks:
- bytedesk-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 5
volumes:
prometheus_data:
name: bytedesk_prometheus_data
networks:
bytedesk-network:
driver: bridge