- #1 SearXNG auth: remove external port, internal-only network, enable limiter - #2 Health checks: add docker-compose healthcheck + depends_on condition - #3 Rate limiting: add per-IP RateLimitMiddleware (30 req/min) - #4 Hardcoded secret: replace with ${SEARXNG_SECRET} env var - #5 Debug disclosure: debug=False, generic error messages, no stack traces - #6 Health endpoint: add /health route returning JSON status - #7 asyncio deprecation: get_event_loop() -> get_running_loop() - #8 httpx reuse: module-level singleton AsyncClient with connection pool
84 lines
2.0 KiB
YAML
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/health')"]
|
|
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
|