docker-compose.yml•1.89 kB
# =============================================================================
# Jina Web Search MCP Server - Docker Compose Configuration
# =============================================================================
# This file defines the complete service stack for the MCP server
#
# Usage:
# docker-compose up -d # Start in background
# docker-compose logs -f # View logs
# docker-compose down # Stop and remove containers
# docker-compose restart # Restart services
# =============================================================================
version: '3.8'
services:
jina-mcp-server:
# Build from local Dockerfile instead of using pre-built image
build: .
# Port mapping: host:container
# Maps localhost:5003 to container port 5003
ports:
- "5003:5003"
# Environment variables with fallback pattern
# Reads JINA_API_KEY from:
# 1. System environment variable
# 2. .env file in same directory
# 3. Falls back to placeholder if neither exists
environment:
- JINA_API_KEY=${JINA_API_KEY:-your_jina_api_key_here}
# Restart policy for production reliability
# Container will restart automatically unless explicitly stopped
restart: unless-stopped
# Health check configuration for monitoring
# Helps Docker/orchestrators know if the service is healthy
healthcheck:
# Test command: makes HTTP request to verify server is responding
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:5003/health', timeout=5)"]
# Health check timing configuration
interval: 30s # Check every 30 seconds
timeout: 10s # Wait up to 10 seconds for response
retries: 3 # Mark unhealthy after 3 failed attempts
start_period: 40s # Grace period during container startup