version: '3.8'
services:
mcp-server:
build: .
ports:
- "${MCP_SERVER_PORT:-8000}:8000"
environment:
- MCP_SERVER_PORT=${MCP_SERVER_PORT:-8000}
- MCP_SERVER_HOST=${MCP_SERVER_HOST:-0.0.0.0}
- DEBUG=${DEBUG:-false}
- MCP_USER_AGENT=${MCP_USER_AGENT:-"MCP Test Server (github.com/modelcontextprotocol/python-sdk)"}
volumes:
# 挂载用户的本地目录到容器内的/host_files目录
- /Users/liuyanzhi/Desktop:/host_files
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/sse"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s