-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (44 loc) · 1.48 KB
/
docker-compose.yml
File metadata and controls
45 lines (44 loc) · 1.48 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
services:
cc-router:
build:
context: .
dockerfile: Dockerfile
ports:
- "${PORT:-3456}:3456"
volumes:
# Mount accounts.json read-write: cc-router must update it when tokens rotate
- ${HOME}/.cc-router/accounts.json:/app/accounts.json
environment:
- PORT=3456
- LITELLM_URL=http://litellm:4000
- ACCOUNTS_PATH=/app/accounts.json
- NODE_ENV=production
depends_on:
litellm:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://localhost:3456/cc-router/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
litellm:
# Pin a specific version — avoid main-latest for production.
# Check releases: https://github.com/BerriAI/litellm/releases
# WARNING: versions 1.82.7 and 1.82.8 contained malware — never use them.
image: ghcr.io/berriai/litellm:main-stable
ports:
- "${LITELLM_PORT:-4000}:4000"
volumes:
- ./litellm-config.yaml:/app/config.yaml:ro
environment:
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY:-cc-router-local-dev}
command: ["--config", "/app/config.yaml", "--port", "4000", "--detailed_debug"]
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:4000/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s