docker-compose配置
关于docker-compose的配置安装可以参考我的这篇笔记: Docker-compose安装配置讲解
创建docker-compose.yml配置文件
version: '3'
services:
prometheus:
image: prom/prometheus:v2.30.3
container_name: prometheus
deploy:
resources:
limits:
cpus: '0.8'
memory: 12G
ports:
- 9090:9090
privileged: true
volumes:
- /data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- /data/prometheus/data:/prometheus
- /app/ca/server/server.crt:/etc/prometheus/server.crt
- /app/ca/server/server.key:/etc/prometheus/server.key
- /app/ca/root/ca.crt:/etc/prometheus/ca.crt
- /data/prometheus/rules:/etc/prometheus/rules
- /data/prometheus/web-config.yml:/etc/prometheus/web-config.yml
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro