version: '3.7'
services:
  prometheus:
    image: prom/prometheus:latest
#    ports:
#      - "9090:9090"
    volumes:
      - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.role == manager
  alertmanager:
    image: prom/alertmanager:latest
#    ports:
#      - "9093:9093"
    volumes:
      - /mnt/docker/home/monitoring/data/alertmanager/data/config.yml:/etc/alertmanager/config.yml
    command:
      - '--config.file=/etc/alertmanager/config.yml'
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.role == manager
  grafana:
    image: grafana/grafana:latest
#    ports:
#      - "3000:3000"
    volumes:
      - /mnt/docker/home/monitoring/data/grafana/data:/var/lib/grafana
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=admin
    deploy:
      replicas: 1