version: '3.8' services: prometheus: image: prom/prometheus:latest container_name: prometheus restart: unless-stopped ports: - "9090:9090" volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - ./alerts.yml:/etc/prometheus/alerts.yml:ro - ./data:/prometheus - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--storage.tsdb.retention.time=60d' - '--web.enable-lifecycle' networks: - monitoring-network blackbox-exporter: image: prom/blackbox-exporter:latest container_name: blackbox-exporter restart: unless-stopped ports: - "9115:9115" volumes: - ./blackbox.yml:/etc/blackbox_exporter/config.yml:ro - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro networks: - monitoring-network alertmanager: image: prom/alertmanager:latest container_name: alertmanager restart: unless-stopped ports: - "9093:9093" volumes: - ./alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro - ./alertmanager-data:/alertmanager - ./smtp_password:/run/secrets/smtp_password:ro - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro command: - '--config.file=/etc/alertmanager/alertmanager.yml' - '--storage.path=/alertmanager' networks: - monitoring-network networks: monitoring-network: driver: bridge