---
version: '3.1'
 
services:
    prometheus-1:
        image: prom/prometheus:v2.50.1
        container_name: prometheus
        logging:
          driver: journald
          options:
            tag: "{{.Name}}"
        volumes:
            - ./prometheus/:/etc/prometheus/
            - /mnt/data/prometheusv1:/prometheus
        command:
            - '--config.file=/etc/prometheus/prometheus.yaml'
            - '--storage.tsdb.path=/prometheus'
            - '--storage.tsdb.max-block-duration=30m'
            - '--storage.tsdb.min-block-duration=30m'
            - '--web.enable-lifecycle'
            - '--web.console.libraries=/usr/share/prometheus/console_libraries'
            - '--web.console.templates=/usr/share/prometheus/consoles'
        ports:
            - 9090:9090
        restart: always
 
    thanos-sidecar-1:
        image: quay.io/thanos/thanos:v0.31.0
        container_name: thanos-sidecar
        logging:
          driver: journald
          options:
            tag: "{{.Name}}"
        volumes:
            - ./thanos/:/etc/thanos/
            - /mnt/data/prometheusv1:/prometheus
        command:
            - 'sidecar'
            - '--tsdb.path=/prometheus'
            - '--prometheus.url=http://prometheus-1:9090'
            - '--grpc-address=0.0.0.0:10091'
            - '--http-address=0.0.0.0:10902'
            - '--objstore.config-file=/etc/thanos/bucket_config.yaml'
        depends_on:
            - prometheus-1
            - minio
        restart: always
 
    minio:
        image: minio/minio:RELEASE.2024-03-10T02-53-48Z
        container_name: minio
        logging:
          driver: journald
          options:
            tag: "{{.Name}}"
        volumes:
            - /mnt/data/miniov1:/data
        command: server /data --console-address ":9001"
        environment:
            - MINIO_ROOT_USER=test
            - MINIO_ROOT_PASSWORD=‘heslo‘
            - MINIO_PROMETHEUS_AUTH_TYPE=public
        ports:
            - 9000:9000
            - 9001:9001
 
    node-exporter:
        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
