-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
270 lines (260 loc) · 8.19 KB
/
docker-compose.yml
File metadata and controls
270 lines (260 loc) · 8.19 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
services:
# PostgreSQL Database
postgres:
image: pgvector/pgvector:pg15
container_name: echograph-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-echograph}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-echograph}
KEYCLOAK_DB: ${KEYCLOAK_DB:-keycloak}
KEYCLOAK_DB_USER: ${KEYCLOAK_DB_USER:-keycloak}
KEYCLOAK_DB_PASSWORD: ${KEYCLOAK_DB_PASSWORD:-keycloak_changeme}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres/init-databases.sh:/docker-entrypoint-initdb.d/init-databases.sh
healthcheck:
test: ["CMD-SHELL", "pg_isready -U echograph"]
interval: 10s
timeout: 5s
retries: 5
networks:
- echograph-network
# Redis for Celery
redis:
image: redis:7-alpine
container_name: echograph-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- echograph-network
# MinIO for S3-compatible storage
minio:
image: minio/minio:latest
container_name: echograph-minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
networks:
- echograph-network
# Qdrant Vector Database
qdrant:
image: qdrant/qdrant:latest
container_name: echograph-qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
environment:
QDRANT__SERVICE__HTTP_PORT: 6333
QDRANT__SERVICE__GRPC_PORT: 6334
networks:
- echograph-network
# n8n Workflow Automation
n8n:
image: n8nio/n8n:latest
container_name: echograph-n8n
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=${N8N_BASIC_AUTH_ACTIVE:-true}
- N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER:-admin}
- N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD:-changeme}
- N8N_HOST=${N8N_HOST:-localhost}
- N8N_PORT=${N8N_PORT:-5678}
- N8N_PROTOCOL=http
- WEBHOOK_URL=http://localhost:5678/
- GENERIC_TIMEZONE=UTC
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
networks:
- echograph-network
# Keycloak Identity and Access Management
keycloak:
image: quay.io/keycloak/keycloak:23.0
container_name: echograph-keycloak
command: start-dev
ports:
- "8080:8080"
environment:
- KEYCLOAK_ADMIN=${KEYCLOAK_ADMIN:-admin}
- KEYCLOAK_ADMIN_PASSWORD=${KEYCLOAK_ADMIN_PASSWORD:-admin_changeme}
- KC_DB=postgres
- KC_DB_URL=jdbc:postgresql://postgres:5432/${KEYCLOAK_DB:-keycloak}
- KC_DB_USERNAME=${KEYCLOAK_DB_USER:-keycloak}
- KC_DB_PASSWORD=${KEYCLOAK_DB_PASSWORD:-keycloak_changeme}
- KC_HOSTNAME_STRICT=false
- KC_HOSTNAME_STRICT_HTTPS=false
- KC_HTTP_ENABLED=true
- KC_HTTP_PORT=8080
- KC_HOSTNAME_PORT=8080
- KC_HEALTH_ENABLED=true
- KC_HOSTNAME_STRICT_BACKCHANNEL=false
- KC_HOSTNAME_URL=${KEYCLOAK_HOSTNAME_URL:-http://localhost:8080}
- KC_HOSTNAME_ADMIN_URL=${KEYCLOAK_HOSTNAME_ADMIN_URL:-http://localhost:8080}
# Disable frame-ancestors CSP to allow iframe embedding
- KC_SPI_SECURITY_HEADERS_FRAME_ANCESTORS=""
volumes:
- keycloak_data:/opt/keycloak/data
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "timeout 2 bash -c '</dev/tcp/localhost/8080' || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 90s
networks:
- echograph-network
# FastAPI Backend
api:
build:
context: .
dockerfile: ./api/Dockerfile
container_name: echograph-api
ports:
- "8000:8000"
environment:
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
- CELERY_BROKER_URL=${CELERY_BROKER_URL:-redis://redis:6379/0}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND:-redis://redis:6379/0}
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-minio:9000}
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-minioadmin}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-minioadmin}
- MINIO_USE_SSL=${MINIO_USE_SSL:-false}
- QDRANT_HOST=${QDRANT_HOST:-qdrant}
- QDRANT_PORT=${QDRANT_PORT:-6333}
- API_SECRET_KEY=${API_SECRET_KEY:-change-this-to-a-random-secret-key}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- KEYCLOAK_SERVER_URL=${KEYCLOAK_SERVER_URL}
- KEYCLOAK_REALM=${KEYCLOAK_REALM:-echograph}
- KEYCLOAK_CLIENT_ID=${KEYCLOAK_CLIENT_ID:-echograph-api}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:8000}
- PYTHONPATH=/app
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
- ./api:/app/api
- ./ingestion:/app/ingestion
- ./processing:/app/processing
- ./data:/app/data
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
qdrant:
condition: service_started
keycloak:
condition: service_started
networks:
- echograph-network
restart: unless-stopped
# Celery Worker
celery-worker:
build:
context: .
dockerfile: ./api/Dockerfile
container_name: echograph-celery-worker
command: celery -A api.tasks worker --loglevel=info
environment:
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
- CELERY_BROKER_URL=${CELERY_BROKER_URL:-redis://redis:6379/0}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND:-redis://redis:6379/0}
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-minio:9000}
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-minioadmin}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-minioadmin}
- MINIO_USE_SSL=${MINIO_USE_SSL:-false}
- QDRANT_HOST=${QDRANT_HOST:-qdrant}
- QDRANT_PORT=${QDRANT_PORT:-6333}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- PYTHONPATH=/app
healthcheck:
test: ["CMD-SHELL", "celery -A api.tasks inspect ping -d celery@$$HOSTNAME"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
- ./api:/app/api
- ./ingestion:/app/ingestion
- ./processing:/app/processing
- ./data:/app/data
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
api:
condition: service_healthy
networks:
- echograph-network
restart: unless-stopped
# Next.js Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000}
- NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL:-ws://localhost:8000}
- NEXT_PUBLIC_KEYCLOAK_URL=${KEYCLOAK_PUBLIC_URL:-http://localhost:8080}
- NEXT_PUBLIC_KEYCLOAK_REALM=${KEYCLOAK_REALM:-echograph}
- NEXT_PUBLIC_KEYCLOAK_CLIENT_ID=${KEYCLOAK_FRONTEND_CLIENT_ID:-echograph-frontend}
container_name: echograph-frontend
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000}
- NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL:-ws://localhost:8000}
- NEXT_PUBLIC_KEYCLOAK_URL=${KEYCLOAK_PUBLIC_URL:-http://localhost:8080}
- NEXT_PUBLIC_KEYCLOAK_REALM=${KEYCLOAK_REALM:-echograph}
- NEXT_PUBLIC_KEYCLOAK_CLIENT_ID=${KEYCLOAK_FRONTEND_CLIENT_ID:-echograph-frontend}
depends_on:
- api
networks:
- echograph-network
restart: unless-stopped
volumes:
postgres_data:
redis_data:
minio_data:
qdrant_data:
n8n_data:
keycloak_data:
networks:
echograph-network:
driver: bridge