|
| 1 | +version: '3.8' |
| 2 | + |
| 3 | +services: |
| 4 | + codealive-mcp: |
| 5 | + # Use the latest stable image from GitHub Container Registry |
| 6 | + image: ghcr.io/codealive-ai/codealive-mcp:main |
| 7 | + |
| 8 | + # Container name for easy reference |
| 9 | + container_name: codealive-mcp-server |
| 10 | + |
| 11 | + # Restart policy - automatically restart if container stops |
| 12 | + restart: unless-stopped |
| 13 | + |
| 14 | + # Port mapping - expose MCP server on port 8000 |
| 15 | + ports: |
| 16 | + - "8000:8000" |
| 17 | + |
| 18 | + # Environment variables |
| 19 | + environment: |
| 20 | + # ========================================== |
| 21 | + # CONFIGURATION FOR SELF-HOSTED CODEALIVE |
| 22 | + # ========================================== |
| 23 | + # Uncomment and set this to your self-hosted CodeAlive instance URL |
| 24 | + # REQUIRED for self-hosted deployments |
| 25 | + # CODEALIVE_BASE_URL: "https://codealive.yourcompany.com" |
| 26 | + |
| 27 | + # ========================================== |
| 28 | + # CONFIGURATION FOR CODEALIVE CLOUD |
| 29 | + # ========================================== |
| 30 | + # For CodeAlive Cloud, comment out or remove CODEALIVE_BASE_URL above |
| 31 | + # The server will use the default: https://app.codealive.ai |
| 32 | + |
| 33 | + # ========================================== |
| 34 | + # API KEY CONFIGURATION (IMPORTANT!) |
| 35 | + # ========================================== |
| 36 | + # In HTTP mode, API keys should be provided by clients via |
| 37 | + # "Authorization: Bearer YOUR_KEY" headers, NOT environment variables. |
| 38 | + # |
| 39 | + # Do NOT set CODEALIVE_API_KEY here in production. |
| 40 | + # Each client connection should provide their own API key. |
| 41 | + |
| 42 | + # ========================================== |
| 43 | + # OPTIONAL SETTINGS |
| 44 | + # ========================================== |
| 45 | + # Enable debug mode (verbose logging) |
| 46 | + # DEBUG_MODE: "false" |
| 47 | + |
| 48 | + # Disable SSL verification (only for development/testing) |
| 49 | + # CODEALIVE_IGNORE_SSL: "false" |
| 50 | + |
| 51 | + # Command to run the MCP server in HTTP mode |
| 52 | + command: > |
| 53 | + python src/codealive_mcp_server.py |
| 54 | + --transport http |
| 55 | + --host 0.0.0.0 |
| 56 | + --port 8000 |
| 57 | +
|
| 58 | + # Health check configuration |
| 59 | + healthcheck: |
| 60 | + test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"] |
| 61 | + interval: 30s |
| 62 | + timeout: 5s |
| 63 | + retries: 3 |
| 64 | + start_period: 10s |
| 65 | + |
| 66 | + # Resource limits (adjust based on your needs) |
| 67 | + deploy: |
| 68 | + resources: |
| 69 | + limits: |
| 70 | + cpus: '0.5' |
| 71 | + memory: 512M |
| 72 | + reservations: |
| 73 | + cpus: '0.25' |
| 74 | + memory: 256M |
| 75 | + |
| 76 | +# ========================================== |
| 77 | +# USAGE INSTRUCTIONS |
| 78 | +# ========================================== |
| 79 | +# |
| 80 | +# 1. Copy this file to docker-compose.yml: |
| 81 | +# cp docker-compose.example.yml docker-compose.yml |
| 82 | +# |
| 83 | +# 2. Edit docker-compose.yml: |
| 84 | +# - For self-hosted: Uncomment and set CODEALIVE_BASE_URL |
| 85 | +# - For cloud: Leave CODEALIVE_BASE_URL commented out |
| 86 | +# |
| 87 | +# 3. Start the service: |
| 88 | +# docker compose up -d |
| 89 | +# |
| 90 | +# 4. Check health: |
| 91 | +# curl http://localhost:8000/health |
| 92 | +# |
| 93 | +# 5. Connect AI clients using: |
| 94 | +# - URL: http://your-server:8000/api |
| 95 | +# - Header: Authorization: Bearer YOUR_API_KEY |
| 96 | +# |
| 97 | +# ========================================== |
| 98 | +# EXAMPLES |
| 99 | +# ========================================== |
| 100 | +# |
| 101 | +# Claude Code: |
| 102 | +# claude mcp add --transport http codealive http://localhost:8000/api \ |
| 103 | +# --header "Authorization: Bearer YOUR_API_KEY" |
| 104 | +# |
| 105 | +# Cursor/Other Clients (JSON config): |
| 106 | +# { |
| 107 | +# "mcpServers": { |
| 108 | +# "codealive": { |
| 109 | +# "url": "http://localhost:8000/api", |
| 110 | +# "headers": { |
| 111 | +# "Authorization": "Bearer YOUR_API_KEY" |
| 112 | +# } |
| 113 | +# } |
| 114 | +# } |
| 115 | +# } |
| 116 | +# |
| 117 | +# ========================================== |
| 118 | +# TROUBLESHOOTING |
| 119 | +# ========================================== |
| 120 | +# |
| 121 | +# View logs: |
| 122 | +# docker compose logs -f codealive-mcp |
| 123 | +# |
| 124 | +# Restart service: |
| 125 | +# docker compose restart codealive-mcp |
| 126 | +# |
| 127 | +# Stop service: |
| 128 | +# docker compose down |
| 129 | +# |
| 130 | +# Update to latest version: |
| 131 | +# docker compose pull |
| 132 | +# docker compose up -d |
0 commit comments