-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
233 lines (221 loc) · 5.76 KB
/
docker-compose.yml
File metadata and controls
233 lines (221 loc) · 5.76 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
services:
# PostgreSQL Database
postgres:
image: postgres:16-alpine
platform: linux/amd64
container_name: postgres
environment:
POSTGRES_DB: opencontext
POSTGRES_USER: user
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- opencontext-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user"]
interval: 30s
timeout: 10s
retries: 5
restart: unless-stopped
# Elasticsearch with Nori plugin
elasticsearch:
build:
context: ./elasticsearch
dockerfile: Dockerfile
container_name: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
- opencontext-network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
restart: unless-stopped
# Ollama Model Downloader
ollama-init:
image: ollama/ollama:latest
platform: linux/amd64
container_name: opencontext-ollama-init
volumes:
- ollama_data:/root/.ollama
networks:
- opencontext-network
environment:
- OLLAMA_HOST=0.0.0.0
entrypoint: /bin/sh
command: -c "ollama serve & sleep 10 && ollama pull dengcao/Qwen3-Embedding-0.6B:F16 && echo 'Model download completed' && pkill ollama"
# Ollama Server for embeddings
ollama:
image: ollama/ollama:latest
platform: linux/amd64
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
networks:
- opencontext-network
environment:
- OLLAMA_HOST=0.0.0.0
- OLLAMA_NUM_PARALLEL=1
depends_on:
- ollama-init
# To enable GPU support, set OLLAMA_RUNTIME=nvidia in your environment.
# If you do not have an NVIDIA GPU, leave OLLAMA_RUNTIME unset.
runtime: ${OLLAMA_RUNTIME:-}
restart: unless-stopped
# Kibana for Elasticsearch management
kibana:
image: docker.elastic.co/kibana/kibana:8.11.3
platform: linux/amd64
container_name: kibana
ports:
- "5601:5601"
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
- XPACK_SECURITY_ENABLED=false
depends_on:
elasticsearch:
condition: service_healthy
networks:
- opencontext-network
restart: unless-stopped
# MinIO Object Storage
minio:
image: minio/minio:latest
platform: linux/amd64
container_name: minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin123!
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
networks:
- opencontext-network
restart: unless-stopped
# FastAPI RAG Service
open-context-rag:
build:
context: ./rag
dockerfile: Dockerfile
image: opencontext/rag:0.1.0
container_name: open-context-rag
ports:
- "8002:8001"
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
- ELASTICSEARCH_INDEX=document_chunks_index
- OLLAMA_URL=http://ollama:11434
- OLLAMA_MODEL=dengcao/Qwen3-Embedding-0.6B:F16
- EMBEDDING_BATCH_SIZE=2
- BM25_WEIGHT=0.3
- VECTOR_WEIGHT=0.7
depends_on:
elasticsearch:
condition: service_healthy
ollama:
condition: service_started
networks:
- opencontext-network
restart: unless-stopped
# Spring Boot Core Service
open-context-core:
build:
context: ./core
dockerfile: Dockerfile
image: opencontext/core:0.1.0
container_name: open-context-core
ports:
- "8080:8080"
environment:
- SPRING_PROFILES_ACTIVE=docker
- APP_RAG_SERVICE_URL=http://open-context-rag:8001
depends_on:
postgres:
condition: service_healthy
elasticsearch:
condition: service_healthy
ollama:
condition: service_started
minio:
condition: service_started
open-context-rag:
condition: service_started
networks:
- opencontext-network
restart: unless-stopped
# Mock Server for testing
open-context-mock-server:
build:
context: ./mcp-adapter
dockerfile: Dockerfile
image: opencontext/mcp-adapter:0.1.0
container_name: open-context-mock-server
ports:
- "8001:8001"
command: ["npm", "run", "mock"]
environment:
- MOCK_SERVER_PORT=8001
networks:
- opencontext-network
restart: unless-stopped
# Node.js MCP Adapter
open-context-mcp-adapter:
build:
context: ./mcp-adapter
dockerfile: Dockerfile
image: opencontext/mcp-adapter:0.1.0
container_name: open-context-mcp-adapter
ports:
- "3000:3000"
environment:
- OPENCONTEXT_CORE_URL=http://open-context-core:8080
- OPENCONTEXT_DEFAULT_TOP_K=5
- OPENCONTEXT_DEFAULT_MAX_TOKENS=25000
- MCP_SERVER_PORT=3000
- MCP_MODE=http
depends_on:
- open-context-core
networks:
- opencontext-network
command: ["node", "dist/index.js", "--transport", "http", "--port", "3000"]
restart: unless-stopped
# Admin UI Frontend
open-context-admin-ui:
build:
context: ./admin-ui
dockerfile: Dockerfile
image: opencontext/admin-ui:0.1.0
container_name: open-context-admin-ui
ports:
- "3001:80"
depends_on:
- open-context-core
networks:
- opencontext-network
restart: unless-stopped
volumes:
postgres_data:
es_data:
ollama_data:
minio_data:
networks:
opencontext-network:
driver: bridge