# Runs the tdmcp MCP server in a container over the HTTP transport.
#
# NOTE: TouchDesigner is NOT containerized — it runs natively on the host
# (the TD Web Server DAT bridge listens on 127.0.0.1:9980 there). The container
# reaches it via `host.docker.internal`, which the extra_hosts mapping below
# resolves to the host gateway (required on Linux; a no-op on Docker Desktop).
services:
  tdmcp:
    build:
      context: .
      dockerfile: Dockerfile
    image: tdmcp-server
    ports:
      - "3939:3939"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      # HTTP transport is mandatory in a container (stdio can't cross the boundary).
      TDMCP_TRANSPORT: http
      TDMCP_HTTP_PORT: "3939"
      # TouchDesigner runs on the host, not in this container.
      TDMCP_TD_HOST: host.docker.internal
      TDMCP_TD_PORT: "9980"
      TDMCP_LOG_LEVEL: info
      TDMCP_REQUEST_TIMEOUT_MS: "10000"
    restart: unless-stopped
