# Apollo MCP Server — local compose.
#   docker compose -f docker-compose.local.yaml up --build
# Runs the bundled local config (config/mcp.local.yaml) on :8080 and loads tools
# from ./operations, mounted so edits hot-reload without a rebuild. Expects a
# graphql-router on the host at :8080 (e.g. `make dev` in graphql-router).
#
# Inside the container `localhost` is the container, not your machine, so the
# config must reach the host router via host.docker.internal — point
# config/mcp.local.yaml's endpoint at http://host.docker.internal:8080/graphql.
# The extra_hosts mapping makes that name resolve on Linux too.
services:
  apollo-mcp:
    command: ["/data/config/mcp.local.yaml"]
    ports:
      - "8080:8080"
    environment:
      # Listen port — read by config/mcp.local.yaml (transport.port: ${env.MCP_PORT}).
      MCP_PORT: "8080"
    env_file:
      - .env
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ./operations:/data/operations:ro
      - ./prompts:/data/prompts/:ro

  datadog:
    image: 086679231553.dkr.ecr.us-east-1.amazonaws.com/orchard-datadog-agent:latest
    ports:
      - 4317:4317
      - 4318:4318
      - 8126:8126
    environment:
      - DD_LOG_LEVEL=info
      - DD_ENV=dev
      - DD_HOSTNAME=docker-local-datadog
      - DD_SERVICE=datadog-agent
      - DD_SITE=datadoghq.com
      - DD_APM_ENABLED=true
      - DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_HTTP_ENDPOINT=0.0.0.0:4318
      - DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINT=0.0.0.0:4317
      - DD_LOGS_ENABLED=true
      - DD_CONTAINER_EXCLUDE=name:datadog
      - DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true
      - DD_OTLP_CONFIG_LOGS_ENABLED=true
      - DD_API_KEY
      - GRAPHQL_ROUTER_URL
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /var/lib/docker/containers:/var/lib/docker/containers:ro
