google-mcp/docker-compose.yml
Jarian Cottingham 645d8820f1 fix: repair middleware wiring, input validation, and resource lifecycle
- Wrap RateLimitMiddleware in Middleware() - bare class broke all requests (500)
- Clamp/validate num param - ?num=abc no longer returns 500
- Query length cap (500), result counts clamped to 1..20
- Wire lifespan into Starlette so shared httpx client closes on shutdown
- Purge stale per-IP rate limit entries to bound memory growth
- URL-encode queries in the Playwright scraper path
- Lazy lib imports so the package works without optional playwright
- Add pyproject.toml (activates ruff/pytest/bandit in CI), README, LICENSE
- Remove committed __pycache__, add .gitignore/.dockerignore
- Fix SearXNG healthcheck path (/health -> /healthz) and compose docs
2026-08-20 23:27:27 +00:00

84 lines
2.0 KiB
YAML

services:
searxng:
image: searxng/searxng:latest
container_name: searxng
expose:
- "8080"
volumes:
- ./searxng-settings.yml:/etc/searxng/settings.yml:ro
environment:
- SEARXNG_BASE_URL=http://localhost:8080/
- SEARXNG_SECRET=${SEARXNG_SECRET:-}
- UWSGI_WORKERS=4
- UWSGI_THREADS=4
restart: unless-stopped
stop_grace_period: 5s
networks:
- mcp-internal
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/healthz')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
google-search:
build:
context: .
dockerfile: google-mcp/Dockerfile
container_name: google-mcp
ports:
- "3001:3001"
environment:
- RATE_LIMIT_SECONDS=5
- MCP_PORT=3001
- SEARXNG_URL=http://searxng:8080
- PYTHONUNBUFFERED=1
depends_on:
searxng:
condition: service_healthy
restart: unless-stopped
stop_grace_period: 5s
networks:
- mcp-internal
- mcp-external
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:3001/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
duckduckgo-search:
build:
context: .
dockerfile: duckduckgo-mcp/Dockerfile
container_name: duckduckgo-mcp
ports:
- "3002:3002"
environment:
- RATE_LIMIT_SECONDS=3
- MCP_PORT=3002
- SEARXNG_URL=http://searxng:8080
- PYTHONUNBUFFERED=1
depends_on:
searxng:
condition: service_healthy
restart: unless-stopped
stop_grace_period: 5s
networks:
- mcp-internal
- mcp-external
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:3002/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
mcp-internal:
internal: true
mcp-external:
driver: bridge