version: '3.8'
services:
  app:
    # build: .
    image: git.cleverthis.com/clevermicro/amq-adapter-python-demo:latest
    ports:
      - "8000:8000"
      - "8001:8001"
    environment:
      - OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
    depends_on:
      - jaeger
      - prometheus
      - rabbitmq
      - alertmanager

  jaeger:
    image: jaegertracing/all-in-one:latest
    ports:
      - "6831:6831/udp"
      - "14268:14268"
      - "14250:14250"
      - "4317:4317"
      - "4318:4318"
      - "16686:16686"
    environment:
      - COLLECTOR_OTLP_ENABLED=true

  prometheus:
    image: prom/prometheus:latest
    volumes:
      - ./container-data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
      - ./container-data/prometheus/alert-rules.yml:/etc/prometheus/alert-rules.yml
    ports:
      - "9090:9090"
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
    depends_on:
      - alertmanager

  alertmanager:
    image: prom/alertmanager:latest
    ports:
      - "9093:9093"
    volumes:
      - ./container-data/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
    command:
      - '--config.file=/etc/alertmanager/alertmanager.yml'

  rabbitmq:
    image: rabbitmq:3-management-alpine
    ports:
      - "5672:5672"
      - "15672:15672"
      - "15692:15692"
    environment:
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest
    volumes:
      - rabbitmq_data:/var/lib/rabbitmq
    labels:
      prometheus-job: rabbitmq

volumes:
  rabbitmq_data:
