-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
242 lines (233 loc) · 7.66 KB
/
docker-compose.yml
File metadata and controls
242 lines (233 loc) · 7.66 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
# Local production-like stack for Phase 1. Usage: docker compose up -d --build
# Host ports chosen to avoid clashes with existing Postgres (5432) / Neo4j (7474, 7687) on the machine.
#
# This is the prod-oriented compose variant: backend runs from the built image, frontend is a static Vite build
# behind nginx on :8787. For hot-reload development use `docker-compose.dev.yml` or `make dev-up`.
#
# `web` (nginx) publishes :8787 and proxies /v1, /health, etc. to `api`. Rebuild UI only: docker compose build web
# Rebuild backend only: docker compose build api
#
# API uses Docker network hostnames (postgres, neo4j, qdrant). Host .env with localhost:* is for
# CLI/benchmarks on the machine; override via compose `environment` below when running the API container.
services:
neo4j:
image: neo4j:5-community
env_file:
- .env
ports:
- "17474:7474"
- "17687:7687"
environment:
NEO4J_AUTH: ${SCIENCE_GRAPHRAG_NEO4J_USER:-neo4j}/${SCIENCE_GRAPHRAG_NEO4J_PASSWORD:-change-me}
volumes:
- neo4j_data:/data
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:7474"]
interval: 20s
timeout: 10s
retries: 6
start_period: 30s
postgres:
image: postgres:16-alpine
env_file:
- .env
ports:
- "15432:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-science}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me}
POSTGRES_DB: ${POSTGRES_DB:-science_graphrag}
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-science} -d ${POSTGRES_DB:-science_graphrag}"]
interval: 20s
timeout: 8s
retries: 8
start_period: 15s
qdrant:
image: qdrant/qdrant:v1.12.4
ports:
- "16333:6333"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: ["CMD", "/qdrant/qdrant", "--version"]
interval: 20s
timeout: 8s
retries: 8
start_period: 10s
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes", "--maxmemory", "512mb", "--maxmemory-policy", "allkeys-lru"]
ports:
- "16379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 20s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
command: ["server", "/data", "--console-address", ":9001"]
ports:
- "19000:9000"
- "19001:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin}
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:9000/minio/health/live"]
interval: 15s
timeout: 5s
retries: 5
start_period: 15s
phoenix:
# Override in `.env` for deterministic builds, e.g.:
# SCIENCE_GRAPHRAG_PHOENIX_IMAGE=arizephoenix/phoenix@sha256:<digest>
image: ${SCIENCE_GRAPHRAG_PHOENIX_IMAGE:-arizephoenix/phoenix:latest}
ports:
- "16006:6006"
- "14317:4317"
volumes:
- phoenix_data:/mnt/data
healthcheck:
test:
[
"CMD",
"python3",
"-c",
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:6006', timeout=5)",
]
interval: 30s
timeout: 10s
retries: 6
start_period: 20s
api:
build:
context: .
dockerfile: Dockerfile
expose:
- "8787"
ports:
# Optional: hit FastAPI directly (bypasses nginx /ui). Main entry remains `web` :8787.
- "18787:8787"
env_file:
- .env
environment:
# Keep DB credentials in sync with the postgres service defaults/.env values.
SCIENCE_GRAPHRAG_DATABASE_URL: ${SCIENCE_GRAPHRAG_DATABASE_URL_DOCKER:-postgresql+psycopg://${POSTGRES_USER:-science}:${POSTGRES_PASSWORD:-change-me}@postgres:5432/${POSTGRES_DB:-science_graphrag}}
SCIENCE_GRAPHRAG_NEO4J_URI: bolt://neo4j:7687
SCIENCE_GRAPHRAG_NEO4J_USER: ${SCIENCE_GRAPHRAG_NEO4J_USER:-neo4j}
SCIENCE_GRAPHRAG_NEO4J_PASSWORD: ${SCIENCE_GRAPHRAG_NEO4J_PASSWORD:-change-me}
SCIENCE_GRAPHRAG_QDRANT_URL: http://qdrant:6333
SCIENCE_GRAPHRAG_REDIS_URL: redis://redis:6379/0
SCIENCE_GRAPHRAG_AGENT_SESSION_MEMORY_BACKEND: redis
SCIENCE_GRAPHRAG_BLOB_ROOT: /data/blobs
SCIENCE_GRAPHRAG_ARTIFACT_ROOT: /data/artifacts
PHOENIX_COLLECTOR_ENDPOINT: http://phoenix:6006/v1/traces
# One LangGraph turn wall clock (sync JSON or SSE collection). Override from host shell, e.g.
# ``SCIENCE_GRAPHRAG_AGENT_STEP_TIMEOUT_SECONDS=300 docker compose up -d api``.
SCIENCE_GRAPHRAG_AGENT_STEP_TIMEOUT_SECONDS: ${SCIENCE_GRAPHRAG_AGENT_STEP_TIMEOUT_SECONDS:-240}
# Phase 1: MinIO on compose network (override via .env MINIO_ROOT_* if needed).
SCIENCE_GRAPHRAG_S3_ENDPOINT_URL: http://minio:9000
SCIENCE_GRAPHRAG_S3_ACCESS_KEY_ID: ${MINIO_ROOT_USER:-minioadmin}
SCIENCE_GRAPHRAG_S3_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD:-minioadmin}
SCIENCE_GRAPHRAG_S3_BUCKET: science-raw
SCIENCE_GRAPHRAG_S3_USE_SSL: "false"
volumes:
- ./data/blobs:/data/blobs
- ./data/artifacts:/data/artifacts
depends_on:
postgres:
condition: service_healthy
neo4j:
condition: service_healthy
qdrant:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8787/health', timeout=5)",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 25s
web:
build:
context: .
dockerfile: Dockerfile.web
ports:
- "8787:80"
depends_on:
api:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"wget",
"-q",
"-O",
"-",
"http://127.0.0.1/health",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
worker:
build:
context: .
dockerfile: Dockerfile
command: ["python", "-m", "science_graphrag.worker"]
env_file:
- .env
environment:
SCIENCE_GRAPHRAG_DATABASE_URL: ${SCIENCE_GRAPHRAG_DATABASE_URL_DOCKER:-postgresql+psycopg://${POSTGRES_USER:-science}:${POSTGRES_PASSWORD:-change-me}@postgres:5432/${POSTGRES_DB:-science_graphrag}}
SCIENCE_GRAPHRAG_NEO4J_URI: bolt://neo4j:7687
SCIENCE_GRAPHRAG_NEO4J_USER: ${SCIENCE_GRAPHRAG_NEO4J_USER:-neo4j}
SCIENCE_GRAPHRAG_NEO4J_PASSWORD: ${SCIENCE_GRAPHRAG_NEO4J_PASSWORD:-change-me}
SCIENCE_GRAPHRAG_QDRANT_URL: http://qdrant:6333
SCIENCE_GRAPHRAG_REDIS_URL: redis://redis:6379/0
SCIENCE_GRAPHRAG_BLOB_ROOT: /data/blobs
SCIENCE_GRAPHRAG_ARTIFACT_ROOT: /data/artifacts
PHOENIX_COLLECTOR_ENDPOINT: http://phoenix:6006/v1/traces
SCIENCE_GRAPHRAG_S3_ENDPOINT_URL: http://minio:9000
SCIENCE_GRAPHRAG_S3_ACCESS_KEY_ID: ${MINIO_ROOT_USER:-minioadmin}
SCIENCE_GRAPHRAG_S3_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD:-minioadmin}
SCIENCE_GRAPHRAG_S3_BUCKET: science-raw
SCIENCE_GRAPHRAG_S3_USE_SSL: "false"
volumes:
- ./data/blobs:/data/blobs
- ./data/artifacts:/data/artifacts
depends_on:
postgres:
condition: service_healthy
neo4j:
condition: service_healthy
qdrant:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
volumes:
neo4j_data:
pg_data:
qdrant_data:
phoenix_data:
redis_data:
minio_data: