-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (114 loc) · 3.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
124 lines (114 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
version: '3.8'
services:
# UniFi MCP Server
unifi-mcp:
build:
context: .
dockerfile: Dockerfile
container_name: unifi-mcp-server
restart: unless-stopped
stdin_open: true # Required for STDIO transport (kept for backward compatibility)
tty: false
ports:
- "${MCP_SERVER_PORT:-3000}:${MCP_SERVER_PORT:-3000}" # Expose for SSE/HTTP transport
environment:
# UniFi API Configuration
UNIFI_API_KEY: ${UNIFI_API_KEY:?UNIFI_API_KEY required}
UNIFI_API_TYPE: ${UNIFI_API_TYPE:-cloud}
UNIFI_HOST: ${UNIFI_HOST:-api.ui.com}
UNIFI_PORT: ${UNIFI_PORT:-443}
UNIFI_LOCAL_HOST: ${UNIFI_LOCAL_HOST:-}
UNIFI_VERIFY_SSL: ${UNIFI_VERIFY_SSL:-true}
UNIFI_SITE: ${UNIFI_SITE:-default}
# MCP Server Transport Configuration
MCP_SERVER_TRANSPORT: ${MCP_SERVER_TRANSPORT:-stdio}
MCP_SERVER_HOST: ${MCP_SERVER_HOST:-0.0.0.0}
MCP_SERVER_PORT: ${MCP_SERVER_PORT:-3000}
MCP_LOG_LEVEL: ${MCP_LOG_LEVEL:-INFO}
# Optional: Rate Limiting
UNIFI_RATE_LIMIT: ${UNIFI_RATE_LIMIT:-100}
UNIFI_TIMEOUT: ${UNIFI_TIMEOUT:-30}
UNIFI_MAX_RETRIES: ${UNIFI_MAX_RETRIES:-3}
UNIFI_PROFILE: ${UNIFI_PROFILE:-network}
DRY_RUN: ${DRY_RUN:-false}
UNIFI_AUDIT_LOG_PATH: ${UNIFI_AUDIT_LOG_PATH:-/app/audit.log}
UNIFI_METRICS_ENABLED: ${UNIFI_METRICS_ENABLED:-false}
UNIFI_WEBHOOK_REDIS_URL: ${UNIFI_WEBHOOK_REDIS_URL:-}
UNIFI_CONTROLLERS: ${UNIFI_CONTROLLERS:-}
# Optional: Agnost Performance Tracking
AGNOST_ENABLED: ${AGNOST_ENABLED:-false}
AGNOST_ORG_ID: ${AGNOST_ORG_ID:-}
AGNOST_ENDPOINT: ${AGNOST_ENDPOINT:-https://api.agnost.ai}
AGNOST_DISABLE_INPUT: ${AGNOST_DISABLE_INPUT:-false}
AGNOST_DISABLE_OUTPUT: ${AGNOST_DISABLE_OUTPUT:-false}
# Optional: Redis Caching
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_DB: ${REDIS_DB:-0}
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
# Optional: Webhook Support
WEBHOOK_SECRET: ${WEBHOOK_SECRET:-}
networks:
- mcp-network
depends_on:
- redis
volumes:
- ./logs:/app/logs
- ./audit.log:/app/audit.log
healthcheck:
test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:3000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# MCP Toolbox - Analytics and Monitoring Dashboard
mcp-toolbox:
image: us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:${TOOLBOX_VERSION:-0.14.0}
container_name: mcp-toolbox
restart: unless-stopped
ports:
- "${TOOLBOX_PORT:-8080}:8080"
command:
- "--tools-file"
- "/app/tools.yaml"
- "--telemetry-otlp"
- "https://api.agnost.ai/v1/otel/${AGNOST_ORG_ID}"
- "--telemetry-service-name"
- "${TOOLBOX_SERVICE_NAME:-unifi-mcp-toolbox}"
volumes:
- ./tools.yaml:/app/tools.yaml:ro
networks:
- mcp-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Redis Cache (Optional but recommended)
redis:
image: redis:7-alpine
container_name: unifi-mcp-redis
restart: unless-stopped
command: >
redis-server
--appendonly yes
--requirepass ${REDIS_PASSWORD:-}
--maxmemory 256mb
--maxmemory-policy allkeys-lru
volumes:
- redis-data:/data
networks:
- mcp-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
networks:
mcp-network:
driver: bridge
volumes:
redis-data:
driver: local