添加 docker-compose/prometheus/promtheus/prometheus.yaml

This commit is contained in:
2026-03-23 10:00:15 +08:00
parent 6616a3e256
commit b29bedbb2d

View File

@@ -0,0 +1,24 @@
version: '3.8'
services:
prometheus:
image: prom/prometheus:v3.5.1
container_name: prometheus
restart: always
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.enable-lifecycle'
- '--storage.tsdb.retention.time=30d'
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- ./config/rules/:/etc/prometheus/rules/
- ./config/targets/:/etc/prometheus/targets/
- ./data:/prometheus
ports:
- "9090:9090"
environment:
- TZ=Asia/Shanghai
deploy:
resources:
limits:
cpus: '1'
memory: 1G