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
140 lines (131 loc) · 3.25 KB
/
docker-compose.yml
File metadata and controls
140 lines (131 loc) · 3.25 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
version: '3.8'
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:
- "8000:8000"
environment:
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-your-secret-key-here}
- POSTGRES_URI=postgresql+asyncpg://morphik:morphik@postgres:5432/morphik
- PGPASSWORD=morphik
- HOST=0.0.0.0
- PORT=8000
- LOG_LEVEL=DEBUG
- REDIS_HOST=redis
- REDIS_PORT=6379
volumes:
- ./storage:/app/storage
- ./logs:/app/logs
- ./morphik.toml:/app/morphik.toml
- huggingface_cache:/root/.cache/huggingface
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
config-check:
condition: service_completed_successfully
ollama:
condition: service_started
required: false
networks:
- morphik-network
env_file:
- .env
worker:
build: .
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
volumes:
- ./storage:/app/storage
- ./logs:/app/logs
- ./morphik.toml:/app/morphik.toml
- huggingface_cache:/root/.cache/huggingface
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
config-check:
condition: service_completed_successfully
ollama:
condition: service_started
required: false
networks:
- morphik-network
env_file:
- .env
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:
build:
context: .
dockerfile: postgres.dockerfile
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"]
networks:
morphik-network:
driver: bridge
volumes:
postgres_data:
ollama_data:
huggingface_cache:
redis_data: