# Docker-in-Docker: MCP talks to an isolated daemon over TLS (not the host socket). # computer-mcp shares the DinD network namespace so DOCKER_HOST is 127.0.0.1:2376. services: docker_dind: container_name: computer-mcp-dind image: docker:dind privileged: true ports: # MCP binds in the shared netns; publish from the DinD service. - "${PORT:-8765}:8765" networks: - nextcloud_docker volumes: - dind-run:/var/run - dind-certs-ca:/certs/ca - dind-certs-client:/certs/client - dind-certs-server:/certs/server environment: DOCKER_TLS_CERTDIR: /certs restart: unless-stopped computer-mcp: container_name: computer-mcp build: . network_mode: "service:docker_dind" depends_on: docker_dind: condition: service_started environment: DOCKER_HOST: tcp://127.0.0.1:2376 DOCKER_TLS_VERIFY: "1" DOCKER_CERT_PATH: /certs/client COMPUTER_MCP_TOKEN: ${COMPUTER_MCP_TOKEN:?set COMPUTER_MCP_TOKEN in .env} COMPUTER_IDLE_TTL_SEC: ${COMPUTER_IDLE_TTL_SEC:-86400} COMPUTER_DNS: ${COMPUTER_DNS:-8.8.8.8} HOST: 0.0.0.0 PORT: "8765" volumes: - dind-certs-client:/certs/client:ro restart: unless-stopped volumes: dind-run: dind-certs-ca: dind-certs-client: dind-certs-server: networks: nextcloud_docker: external: true