-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
142 lines (133 loc) · 4.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
142 lines (133 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
version: "3.8"
name: mroute
# Base Docker Compose configuration for mRoute
# Works for both Desktop Docker (local) and server deployment
#
# Usage:
# Desktop: docker-compose up -d
# Server: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
# Dev: docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d
services:
# mRoute API Server - Core LLM routing service
MROUTE-API:
build:
context: .
dockerfile: docker/Dockerfile.api
args:
- NODE_ENV=production
image: mroute/api:latest
container_name: mroute-api
ports:
- "${MROUTE_API_PORT:-8787}:8787"
environment:
- NODE_ENV=production
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:?ANTHROPIC_API_KEY is required}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
- MROUTE_DEFAULT_PROVIDER=${MROUTE_DEFAULT_PROVIDER:-anthropic}
- MROUTE_LOAD_BALANCING=${MROUTE_LOAD_BALANCING:-priority}
- MROUTE_CACHE_ENABLED=${MROUTE_CACHE_ENABLED:-true}
- MROUTE_FALLBACK_ENABLED=${MROUTE_FALLBACK_ENABLED:-true}
- MROUTE_LOG_LEVEL=${MROUTE_LOG_LEVEL:-info}
- MROUTE_RATE_LIMIT_ENABLED=${MROUTE_RATE_LIMIT_ENABLED:-true}
- REDIS_URL=${REDIS_URL:-redis://MROUTE-REDIS:6379}
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:8787/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
networks:
- mroute
volumes:
- api_logs:/app/logs
MROUTE-WEB:
build:
context: .
dockerfile: docker/Dockerfile.web
image: mroute/web:latest
container_name: mroute-web
ports:
- "${MROUTE_WEB_PORT:-3000}:80"
environment:
- API_URL=http://MROUTE-API:8787
- NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-auto}
- NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-1024}
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
depends_on:
MROUTE-API:
condition: service_healthy
restart: unless-stopped
networks:
- mroute
MROUTE-MCP:
build:
context: .
dockerfile: docker/Dockerfile.mcp
image: mroute/mcp:latest
container_name: mroute-mcp
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- MROUTE_DEFAULT_PROVIDER=${MROUTE_DEFAULT_PROVIDER:-anthropic}
profiles:
- mcp
- full
networks:
- mroute
# MCP runs in stdio mode - interactive, not persistent
stdin_open: true
tty: true
MROUTE-REDIS:
image: redis:7-alpine
container_name: mroute-redis
ports:
- "${MROUTE_REDIS_PORT:-6379}:6379"
command: >
redis-server
--maxmemory ${REDIS_MAXMEMORY:-256mb}
--maxmemory-policy ${REDIS_MAXMEMORY_POLICY:-allkeys-lru}
--appendonly ${REDIS_APPENDONLY:-yes}
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
restart: unless-stopped
networks:
- mroute
MROUTE-WATCHTOWER:
image: containrrr/watchtower:latest
container_name: mroute-watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_POLL_INTERVAL=${WATCHTOWER_INTERVAL:-3600}
- WATCHTOWER_INCLUDE_STOPPED=true
- WATCHTOWER_REVIVE_STOPPED=false
- WATCHTOWER_NOTIFICATIONS=${WATCHTOWER_NOTIFICATIONS:-}
- WATCHTOWER_NOTIFICATION_EMAIL_FROM=${WATCHTOWER_EMAIL_FROM:-}
- WATCHTOWER_NOTIFICATION_EMAIL_TO=${WATCHTOWER_EMAIL_TO:-}
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER=${WATCHTOWER_EMAIL_SERVER:-}
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=${WATCHTOWER_EMAIL_PORT:-587}
profiles:
- server
- production
restart: unless-stopped
volumes:
redis_data:
driver: local
api_logs:
driver: local
networks:
mroute:
driver: bridge