---
version: '3.5'

services:
  vmagent:
    container_name: vmagent
    image: victoriametrics/vmagent:v1.99.0
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    depends_on:
      - "vminsert"
    ports:
      - 8429:8429
    volumes:
      - /mnt/data/vmagentdata/:/vmagentdata
      - ./prometheus/prometheus-config.yaml:/etc/prometheus/prometheus.yml
    command:
      - '--promscrape.config=/etc/prometheus/prometheus.yml'
      - '--remoteWrite.url=http://vminsert:8480/insert/0/prometheus/'
    restart: always

  vmstorage-1:
    container_name: vmstorage-1
    image: victoriametrics/vmstorage:v1.99.0-cluster
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    ports:
      - 8482
      - 8400
      - 8401
    volumes:
      - /mnt/data/stordata/strgdata-1:/storage
    command:
      - '--storageDataPath=/storage'
    restart: always
  vmstorage-2:
    container_name: vmstorage-2
    image: victoriametrics/vmstorage:v1.99.0-cluster
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    ports:
      - 8482
      - 8400
      - 8401
    volumes:
      - /mnt/data/stordata/strgdata-2:/storage
    command:
      - '--storageDataPath=/storage'
    restart: always

  vminsert:
    container_name: vminsert
    image: victoriametrics/vminsert:v1.99.0-cluster
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    depends_on:
      - "vmstorage-1"
      - "vmstorage-2"
    command:
      - '--storageNode=vmstorage-1:8400'
      - '--storageNode=vmstorage-2:8400'
    ports:
      - 8480
    restart: always

  vmselect-1:
    container_name: vmselect-1
    image: victoriametrics/vmselect:v1.99.0-cluster
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    depends_on:
      - "vmstorage-1"
      - "vmstorage-2"
    command:
      - '--storageNode=vmstorage-1:8401'
      - '--storageNode=vmstorage-2:8401'
    ports:
      - 8481
    restart: always
  vmselect-2:
    container_name: vmselect-2
    image: victoriametrics/vmselect:v1.99.0-cluster
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    depends_on:
      - "vmstorage-1"
      - "vmstorage-2"
    command:
      - '--storageNode=vmstorage-1:8401'
      - '--storageNode=vmstorage-2:8401'
    ports:
      - 8481
    restart: always

  vmauth:
    container_name: vmauth
    image: victoriametrics/vmauth:v1.99.0
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    depends_on:
      - "vmselect-1"
      - "vmselect-2"
    volumes:
      - ./auth-lb/auth-config.yaml:/etc/auth.yml
    command:
      - '--auth.config=/etc/auth.yml'
    ports:
      - 8427:8427
    restart: always

  node-exporter-1:
    image: prom/node-exporter:v1.7.0
    container_name: node-exporter
    logging:
      driver: journald
      options:
        tag: "{{.Name}}"
    volumes:
        - /proc:/host/proc:ro
        - /sys:/host/sys:ro
        - /:/rootfs:ro
    command:
        - '--path.procfs=/host/proc'
        - '--path.sysfs=/host/sys'
        - --collector.filesystem.ignored-mount-points
        - "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
    ports:
        - 9100:9100
    restart: always	
