services:
  docker-compose-dashboard:
    image: "mcr.microsoft.com/dotnet/nightly/aspire-dashboard:latest"
    expose:
      - "18888"
      - "18889"
    networks:
      - "aspire"
    restart: "always"
  cache:
    image: "docker.io/library/redis:8.2"
    command:
      - "-c"
      - "redis-server --requirepass $$REDIS_PASSWORD"
    entrypoint:
      - "/bin/sh"
    environment:
      REDIS_PASSWORD: "${CACHE_PASSWORD}"
    expose:
      - "6379"
    networks:
      - "aspire"
  queue:
    image: "docker.io/library/nats:2.11"
    command:
      - "--user"
      - "nats"
      - "--pass"
      - "${QUEUE_PASSWORD}"
      - "-js"
    expose:
      - "4222"
    networks:
      - "aspire"
  ring:
    image: "${RING_IMAGE}"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      HTTP_PORTS: "8080"
      HTTPS_PORTS: "7001"
      ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
      ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
      services__pass__http__0: "http://pass:8080"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://docker-compose-dashboard:18889"
      OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
      OTEL_SERVICE_NAME: "ring"
    expose:
      - "8080"
      - "7001"
    networks:
      - "aspire"
  pass:
    image: "${PASS_IMAGE}"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      HTTP_PORTS: "8080"
      HTTPS_PORTS: "7001"
      services__ring__http__0: "http://ring:8080"
      services__develop__http__0: "http://develop:8080"
      services__drive__http__0: "http://drive:8080"
      ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
      ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://docker-compose-dashboard:18889"
      OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
      OTEL_SERVICE_NAME: "pass"
    expose:
      - "8080"
      - "7001"
    networks:
      - "aspire"
  drive:
    image: "${DRIVE_IMAGE}"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      HTTP_PORTS: "8080"
      HTTPS_PORTS: "7001"
      services__pass__http__0: "http://pass:8080"
      services__ring__http__0: "http://ring:8080"
      ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
      ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://docker-compose-dashboard:18889"
      OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
      OTEL_SERVICE_NAME: "drive"
    expose:
      - "8080"
      - "7001"
    networks:
      - "aspire"
  sphere:
    image: "${SPHERE_IMAGE}"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      HTTP_PORTS: "8080"
      HTTPS_PORTS: "7001"
      services__pass__http__0: "http://pass:8080"
      services__ring__http__0: "http://ring:8080"
      services__drive__http__0: "http://drive:8080"
      ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
      ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://docker-compose-dashboard:18889"
      OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
      OTEL_SERVICE_NAME: "sphere"
    expose:
      - "8080"
      - "7001"
    networks:
      - "aspire"
  develop:
    image: "${DEVELOP_IMAGE}"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      HTTP_PORTS: "8080"
      HTTPS_PORTS: "7001"
      services__pass__http__0: "http://pass:8080"
      services__ring__http__0: "http://ring:8080"
      services__sphere__http__0: "http://sphere:8080"
      ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
      ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://docker-compose-dashboard:18889"
      OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
      OTEL_SERVICE_NAME: "develop"
    expose:
      - "8080"
      - "7001"
    networks:
      - "aspire"
  insight:
    image: "${INSIGHT_IMAGE}"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      HTTP_PORTS: "8080"
      HTTPS_PORTS: "7001"
      services__pass__http__0: "http://pass:8080"
      services__ring__http__0: "http://ring:8080"
      services__sphere__http__0: "http://sphere:8080"
      services__develop__http__0: "http://develop:8080"
      ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
      ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://docker-compose-dashboard:18889"
      OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
      OTEL_SERVICE_NAME: "insight"
    expose:
      - "8080"
      - "7001"
    networks:
      - "aspire"
  gateway:
    image: "${GATEWAY_IMAGE}"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      HTTP_PORTS: "5001"
      services__ring__http__0: "http://ring:8080"
      services__pass__http__0: "http://pass:8080"
      services__drive__http__0: "http://drive:8080"
      services__sphere__http__0: "http://sphere:8080"
      services__develop__http__0: "http://develop:8080"
      services__insight__http__0: "http://insight:8080"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://docker-compose-dashboard:18889"
      OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
      OTEL_SERVICE_NAME: "gateway"
    expose:
      - "5001"
    networks:
      - "aspire"
networks:
  aspire:
    driver: "bridge"
