-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
185 lines (176 loc) · 4.41 KB
/
docker-compose.yml
File metadata and controls
185 lines (176 loc) · 4.41 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
services:
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 10s
retries: 3
minio-setup:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
sleep 5;
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb local/lancedb --ignore-existing;
echo 'Bucket created';
"
embedding:
build:
context: ./embedding
dockerfile: Dockerfile
ports:
- "8001:8001"
volumes:
- ./embedding/models:/app/models
environment:
EMBEDDING_MODEL_PATH: /app/models/qwen3-embedding-0.6b
EMBEDDING_PORT: "8001"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
llm:
build:
context: ./llm
dockerfile: Dockerfile
ports:
- "8004:8004"
volumes:
- ./llm/models:/app/models
environment:
LLM_MODEL_PATH: /app/models/qwen2.5-3b-instruct
LLM_PORT: "8004"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
ingestion:
build:
context: .
dockerfile: ingestion/Dockerfile
ports:
- "8002:8080"
depends_on:
- minio
- minio-setup
- embedding
environment:
LANCEDB_URI: s3://lancedb/documents
S3_ENDPOINT: http://minio:9000
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_REGION: us-east-1
EMBEDDING_SERVICE_URL: http://embedding:8001
chat:
build:
context: .
dockerfile: chat/Dockerfile
ports:
- "8003:8080"
depends_on:
- minio
- minio-setup
- embedding
- mongo
environment:
LANCEDB_URI: s3://lancedb/documents
S3_ENDPOINT: http://minio:9000
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_REGION: us-east-1
EMBEDDING_SERVICE_URL: http://embedding:8001
LLM_SERVICE_URL: http://llm:8004
MONGO_URI: mongodb://root:example@mongo:27017
gateway:
build:
context: .
dockerfile: gateway/Dockerfile
target: dev
ports:
- "8080:8080"
environment:
GATEWAY_PORT: "8080"
INGESTION_LAMBDA_ENDPOINT: http://ingestion:8080
CHAT_LAMBDA_ENDPOINT: http://chat:8080
LLM_SERVICE_URL: http://llm:8004
volumes:
- ./gateway:/app
- /app/node_modules
web:
build:
context: .
dockerfile: web/Dockerfile.dev
target: dev
ports:
- "3000:3000"
depends_on:
- gateway
- ingestion
environment:
NEXT_PUBLIC_WS_URL: ws://192.168.2.17:8080/ws
INGESTION_LAMBDA_URL: http://ingestion:8080/2015-03-31/functions/function/invocations
volumes:
- ./web:/app
- ./shared:/shared
- /app/node_modules
- /app/.next
mongo:
image: mongo:8.2.3-noble
container_name: example-rag-mongodb
restart: unless-stopped
ports:
- "9002:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: example_rag
volumes:
# Persistent data volume with 1GB limit (enforced at Docker level)
- mongo_data:/data/db
# Initialization script (runs on first startup when data dir is empty)
- ./db/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
# MongoDB configuration
- ./db/mongod.conf:/etc/mongod.conf:ro
deploy:
resources:
limits:
memory: 512M # Limit container memory
# MongoDB configuration loaded from mongod.conf
command: ["mongod", "--config", "/etc/mongod.conf"]
healthcheck:
test: mongosh --eval 'db.runCommand("ping").ok' localhost:27017/example_rag --quiet
interval: 10s
timeout: 5s
retries: 5
start_period: 40s
volumes:
minio-data:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/minio-data
mongo_data:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/db/data