-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (109 loc) · 3.26 KB
/
Copy pathdocker-compose.yml
File metadata and controls
114 lines (109 loc) · 3.26 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
services:
ollama:
image: hwdsl2/ollama-server
container_name: ollama
restart: always
volumes:
- ollama-data:/var/lib/ollama
- ollama-shared:/var/lib/ollama-shared
# - ./ollama.env:/ollama.env:ro # optional: custom config
healthcheck:
test: ["CMD", "curl", "-sf", "http://127.0.0.1:11434/"]
interval: 15s
timeout: 3s
start_period: 60s
retries: 3
ai-stack-init:
image: alpine:3.24
container_name: ai-stack-init
restart: "no"
environment:
LITELLM_POSTGRES_PASSWORD: ${LITELLM_POSTGRES_PASSWORD:-}
AI_STACK_VARIANT: ai-tools
AI_STACK_ACCEL: cpu
AI_STACK_DISABLE_USAGE_COUNTS: "${AI_STACK_DISABLE_USAGE_COUNTS:-}"
volumes:
- litellm-db:/var/lib/postgresql:ro
- ai-stack-shared:/var/lib/ai-stack-shared
- ../../VERSION:/etc/ai-stack/VERSION:ro
- ../../scripts/ai-stack-init.sh:/usr/local/bin/ai-stack-init.sh:ro
entrypoint: ["/bin/sh", "/usr/local/bin/ai-stack-init.sh"]
db:
image: pgvector/pgvector:pg18-trixie
container_name: litellm-db
restart: always
environment:
POSTGRES_USER: litellm
POSTGRES_PASSWORD_FILE: /var/lib/ai-stack-shared/litellm_postgres_password
POSTGRES_DB: litellm
volumes:
- litellm-db:/var/lib/postgresql
- ai-stack-shared:/var/lib/ai-stack-shared:ro
depends_on:
ai-stack-init:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "pg_isready -U litellm"]
interval: 15s
timeout: 5s
retries: 5
litellm:
image: hwdsl2/litellm-server
container_name: litellm
restart: always
ports:
- "4000:4000/tcp" # For a host-based reverse proxy, change to "127.0.0.1:4000:4000/tcp"
environment:
- LITELLM_OLLAMA_BASE_URL=http://ollama:11434
- LITELLM_MCP_URL=http://mcp:3000/mcp
- LITELLM_POSTGRES_PASSWORD_FILE=/var/lib/ai-stack-shared/litellm_postgres_password
volumes:
- litellm-data:/etc/litellm
- ai-stack-shared:/var/lib/ai-stack-shared:ro
- ollama-shared:/var/lib/ollama-shared:ro
- mcp-shared:/var/lib/mcp-shared:ro
# - ./litellm.env:/litellm.env:ro # optional: custom config
healthcheck:
test: ["CMD", "curl", "-sf", "http://127.0.0.1:4000/health/liveliness"]
interval: 15s
timeout: 5s
start_period: 300s
retries: 5
depends_on:
ollama:
condition: service_healthy
mcp:
condition: service_healthy
db:
condition: service_healthy
mcp:
image: hwdsl2/mcp-gateway
container_name: mcp
restart: always
# ports:
# - "3000:3000/tcp" # Uncomment for direct MCP client access (e.g. Claude Desktop, Cursor)
volumes:
- mcp-data:/var/lib/mcp
- mcp-shared:/var/lib/mcp-shared
# - ./mcp.env:/mcp.env:ro # optional: custom config
healthcheck:
test: ["CMD", "curl", "-sf", "http://127.0.0.1:3000/health"]
interval: 15s
timeout: 3s
start_period: 60s
retries: 3
volumes:
ollama-data:
name: ollama-data
ollama-shared:
name: ollama-shared
litellm-data:
name: litellm-data
mcp-data:
name: mcp-data
mcp-shared:
name: mcp-shared
ai-stack-shared:
name: ai-stack-shared
litellm-db:
name: litellm-db