-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
209 lines (197 loc) · 6.47 KB
/
docker-compose.yml
File metadata and controls
209 lines (197 loc) · 6.47 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
x-app-env: &app-env
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-memoryos}:${POSTGRES_PASSWORD:-memoryos123}@postgres:5432/${POSTGRES_DB:-memoryos}
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/1
QDRANT_URL: ${QDRANT_URL:-http://qdrant:6333}
QDRANT_API_KEY: ${QDRANT_API_KEY:-}
AWS_ENDPOINT_URL: ${AWS_ENDPOINT_URL:-http://localstack:4566}
APP_ENV: ${APP_ENV:-development}
APP_VERSION: ${APP_VERSION:-dev}
x-app-service: &app-service
build:
context: .
dockerfile: Dockerfile
image: memoryos-api:latest
env_file:
- .env
environment: *app-env
init: true
restart: unless-stopped
services:
api:
<<: *app-service
command: ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_healthy
localstack:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5)\""]
interval: 15s
timeout: 5s
retries: 5
start_period: 15s
celery-enterprise:
<<: *app-service
command: ["celery", "-A", "api.celery_app.celery_app", "worker", "-Q", "enterprise-extraction", "-c", "4", "--prefetch-multiplier", "1", "--loglevel=info", "--pidfile=/tmp/celery-enterprise.pid"]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_healthy
localstack:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import os; pid = int(open('/tmp/celery-enterprise.pid', 'r', encoding='utf-8').read().strip()); os.kill(pid, 0)\""]
interval: 20s
timeout: 5s
retries: 5
start_period: 20s
celery-growth:
<<: *app-service
command: ["celery", "-A", "api.celery_app.celery_app", "worker", "-Q", "growth-extraction", "-c", "3", "--prefetch-multiplier", "1", "--loglevel=info", "--pidfile=/tmp/celery-growth.pid"]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_healthy
localstack:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import os; pid = int(open('/tmp/celery-growth.pid', 'r', encoding='utf-8').read().strip()); os.kill(pid, 0)\""]
interval: 20s
timeout: 5s
retries: 5
start_period: 20s
celery-starter:
<<: *app-service
command: ["celery", "-A", "api.celery_app.celery_app", "worker", "-Q", "starter-extraction,free-extraction", "-c", "3", "--prefetch-multiplier", "1", "--loglevel=info", "--pidfile=/tmp/celery-starter.pid"]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_healthy
localstack:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import os; pid = int(open('/tmp/celery-starter.pid', 'r', encoding='utf-8').read().strip()); os.kill(pid, 0)\""]
interval: 20s
timeout: 5s
retries: 5
start_period: 20s
celery-background:
<<: *app-service
command: ["celery", "-A", "api.celery_app.celery_app", "worker", "-Q", "celery,reembedding,dead-letter", "-c", "2", "--prefetch-multiplier", "1", "--loglevel=info", "--pidfile=/tmp/celery-background.pid"]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_healthy
localstack:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import os; pid = int(open('/tmp/celery-background.pid', 'r', encoding='utf-8').read().strip()); os.kill(pid, 0)\""]
interval: 20s
timeout: 5s
retries: 5
start_period: 20s
celery-beat:
<<: *app-service
command: ["celery", "-A", "api.celery_app.celery_app", "beat", "--loglevel=info", "--pidfile=/tmp/celery-beat.pid", "--schedule=/tmp/celerybeat-schedule"]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_healthy
localstack:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import os; pid = int(open('/tmp/celery-beat.pid', 'r', encoding='utf-8').read().strip()); os.kill(pid, 0)\""]
interval: 20s
timeout: 5s
retries: 5
start_period: 20s
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-memoryos}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-memoryos123}
POSTGRES_DB: ${POSTGRES_DB:-memoryos}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-memoryos} -d ${POSTGRES_DB:-memoryos}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
qdrant:
image: qdrant/qdrant:latest
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: ["CMD-SHELL", "bash -lc 'exec 3<>/dev/tcp/127.0.0.1/6333'"]
interval: 15s
timeout: 5s
retries: 5
start_period: 15s
restart: unless-stopped
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
localstack:
image: localstack/localstack:latest
environment:
SERVICES: ${LOCALSTACK_SERVICES:-s3,sqs}
LOCALSTACK_ACKNOWLEDGE_ACCOUNT_REQUIREMENT: ${LOCALSTACK_ACKNOWLEDGE_ACCOUNT_REQUIREMENT:-1}
ports:
- "4566:4566"
volumes:
- localstack_data:/var/lib/localstack
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:4566/_localstack/health', timeout=5)\""]
interval: 15s
timeout: 5s
retries: 5
start_period: 15s
restart: unless-stopped
volumes:
postgres_data:
qdrant_data:
redis_data:
localstack_data: