version: '3'
services:
thingspanel-mcp:
build:
context: .
dockerfile: Dockerfile
container_name: thingspanel-mcp
restart: unless-stopped
ports:
- "8000:8000"
environment:
- THINGSPANEL_URL=http://demo.thingspanel.cn/
- THINGSPANEL_API_KEY=${THINGSPANEL_API_KEY}
volumes:
- ./:/app:ro # Mount as read-only for safer operation
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
# Optional integration with MCP Inspector for debugging
mcp-inspector:
image: node:18
container_name: mcp-inspector
restart: unless-stopped
ports:
- "5173:5173"
- "3000:3000"
working_dir: /app
command: >
sh -c "npm install -g @modelcontextprotocol/inspector &&
npx @modelcontextprotocol/inspector --host 0.0.0.0 -- bash -c 'nc -U /shared/mcp.sock'"
volumes:
- ./:/app:ro
- shared:/shared
depends_on:
- thingspanel-mcp
volumes:
shared: