version: "3.9"

networks:
  default:
    name: roll
    driver: bridge

services:
  rolldice:
    depends_on:
      - jaeger
    build:
      context: .
      dockerfile: ./Dockerfile
    pid: "host"
    ports:
      - "8080:8080"
    volumes:
      - /proc:/host/proc
  go-auto:
    depends_on:
      - rolldice
    build:
      context: ../..
      dockerfile: Dockerfile
    privileged: true
    pid: "host"
    environment:
      - OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318
      - OTEL_GO_AUTO_TARGET_EXE=/app/main
      - OTEL_SERVICE_NAME=rolldice
      - OTEL_PROPAGATORS=tracecontext,baggage
    volumes:
      - /proc:/host/proc

  jaeger:
    image: jaegertracing/all-in-one:1.60@sha256:4fd2d70fa347d6a47e79fcb06b1c177e6079f92cba88b083153d56263082135e
    ports:
      - "16686:16686"
      - "14268:14268"
    environment:
      - COLLECTOR_OTLP_ENABLED=true
      - LOG_LEVEL=debug
    deploy:
      resources:
        limits:
          memory: 300M
    restart: unless-stopped
