forked from morphik-org/morphik-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
209 lines (198 loc) · 5.29 KB
/
docker-compose.yml
File metadata and controls
209 lines (198 loc) · 5.29 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
# Purpose: Development Docker Compose configuration
# This file is for local development - it builds images from source code
# Use start-dev.sh to run this with automatic port detection from morphik.toml
# Note: This is NOT for production use - see docker-compose.run.yml for production
x-ollama-check: &ollama-check
# This command reads the toml file and checks if any provider is set to "ollama"
command: >
/bin/sh -c '
grep -q "provider *= *\"ollama\"" morphik.toml &&
echo "true" > /tmp/needs_ollama ||
echo "false" > /tmp/needs_ollama'
services:
config-check:
image: alpine
volumes:
- ./morphik.toml:/morphik.toml
<<: *ollama-check
morphik:
build: .
ports:
# Note: Update this port mapping to match the port in morphik.toml
- "8000:8000"
environment:
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-your-secret-key-here}
- POSTGRES_URI=postgresql+asyncpg://morphik:morphik@postgres:5432/morphik
- PGPASSWORD=morphik
- LOG_LEVEL=DEBUG
- REDIS_HOST=redis
- REDIS_PORT=6379
- JINA_AI_API_KEY=${JINA_AI_API_KEY}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- MORPHIK_EMBEDDING_API_KEY=local-dummy-key
volumes:
- ./storage:/app/storage
- ./logs:/app/logs
- ./morphik.toml:/app/morphik.toml
- huggingface_cache:/root/.cache/huggingface
- ./core:/app/core
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
config-check:
condition: service_completed_successfully
ollama:
condition: service_started
required: false
colpali-service:
condition: service_started
required: false
networks:
- morphik-network
env_file:
- .env
worker:
build:
context: .
dockerfile: dockerfile
command: arq core.workers.ingestion_worker.WorkerSettings
environment:
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-your-secret-key-here}
- POSTGRES_URI=postgresql+asyncpg://morphik:morphik@postgres:5432/morphik
- PGPASSWORD=morphik
- LOG_LEVEL=DEBUG
- REDIS_HOST=redis
- REDIS_PORT=6379
- JINA_AI_API_KEY=${JINA_AI_API_KEY}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- MORPHIK_EMBEDDING_API_KEY=local-dummy-key
volumes:
- ./storage:/app/storage
- ./logs:/app/logs
- ./morphik.toml:/app/morphik.toml
- huggingface_cache:/root/.cache/huggingface
- ./core:/app/core
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
config-check:
condition: service_completed_successfully
ollama:
condition: service_started
required: false
colpali-service:
condition: service_started
required: false
networks:
- morphik-network
env_file:
- .env
colpali-service:
build:
context: .
dockerfile: dockerfile.colpali
ports:
- "8001:8001"
environment:
- COLPALI_PORT=8001
- COLPALI_HOST=0.0.0.0
volumes:
- huggingface_cache:/root/.cache/huggingface
- ./colpali_service.py:/app/colpali_service.py
networks:
- morphik-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- morphik-network
postgres:
image: pgvector/pgvector:pg16
shm_size: 128mb
environment:
- POSTGRES_USER=morphik
- POSTGRES_PASSWORD=morphik
- POSTGRES_DB=morphik
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U morphik -d morphik"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- morphik-network
ollama:
image: ollama/ollama:latest
profiles:
- ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
- ./ollama-entrypoint.sh:/ollama-entrypoint.sh
networks:
- morphik-network
entrypoint: ["/ollama-entrypoint.sh"]
ui:
image: node:22-alpine
container_name: morphik-ui
# Enable this profile to run the Web UI
profiles:
- ui
working_dir: /app
command: sh -c "npm install && npm run build && npm start -- -H 0.0.0.0"
environment:
- NODE_ENV=production
- PORT=3003
- API_BASE_URL=${MORPHIK_API_BASE_URL:-http://localhost:8000}
ports:
- "3003:3003"
volumes:
- ./ee/ui-component:/app
- ui_node_modules:/app/node_modules
- ui_next:/app/.next
depends_on:
- morphik
networks:
- morphik-network
networks:
morphik-network:
driver: bridge
volumes:
postgres_data:
ollama_data:
huggingface_cache:
redis_data:
ui_node_modules:
ui_next: