Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (124 loc) · 3.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
133 lines (124 loc) · 3.44 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
name: memory-agent
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- cluster.routing.allocation.disk.threshold_enabled=false
ports:
- "9200:9200"
volumes:
- es_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200 >/dev/null || exit 1"]
interval: 10s
timeout: 10s
retries: 5
redis:
image: redis:alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
postgres:
image: postgres:16-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=litellm
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d litellm"]
interval: 5s
timeout: 5s
retries: 5
litellm:
image: ghcr.io/berriai/litellm:main-latest
ports:
- "4000:4000"
volumes:
- ./litellm_config.yaml:/app/config.yaml
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- GEMINI_API_KEY=${GEMINI_API_KEY}
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY}
- LITELLM_SALT_KEY=${LITELLM_SALT_KEY}
- LITELLM_DASHBOARD_USERNAME=${UI_USERNAME}
- LITELLM_DASHBOARD_PASSWORD=${UI_PASSWORD}
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/litellm
- LITELLM_DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/litellm
- LITELLM_MODE=${LITELLM_MODE}
- USE_PRISMA_MIGRATE=${USE_PRISMA_MIGRATE}
- STORE_MODEL_IN_DB=${STORE_MODEL_IN_DB}
command: ["--config", "/app/config.yaml", "--port", "4000"]
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
api:
build: .
command: uvicorn interface.api.main:app --host 0.0.0.0 --port 8000 --reload
volumes:
- .:/app
ports:
- "8000:8000"
environment:
- GEMINI_API_KEY=${GEMINI_API_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ES_HOST=http://elasticsearch:9200
- OLLAMA_BASE_URL=http://ollama:11434
- REDIS_HOST=redis
- LITELLM_PROXY_URL=http://litellm:4000
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY}
depends_on:
elasticsearch:
condition: service_healthy
redis:
condition: service_healthy
worker:
build: .
command: python src/worker.py
volumes:
- .:/app
environment:
- GEMINI_API_KEY=${GEMINI_API_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ES_HOST=http://elasticsearch:9200
- REDIS_HOST=redis
- LITELLM_PROXY_URL=http://litellm:4000
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY}
depends_on:
elasticsearch:
condition: service_healthy
redis:
condition: service_healthy
ollama:
image: ollama/ollama:latest
ports:
- "11435:11434"
volumes:
- ollama_data:/root/.ollama
ui:
build: .
container_name: memory-ui
command: streamlit run interface/ui/app.py --server.address 0.0.0.0
volumes:
- .:/app
ports:
- "8501:8501"
environment:
- API_URL=http://api:8000
depends_on:
- api
- ollama
volumes:
es_data:
ollama_data:
postgres_data: