-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
390 lines (373 loc) · 12.8 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
390 lines (373 loc) · 12.8 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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
services:
ysweet:
image: ghcr.io/juspay/y-sweet:sha-221d5af
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-ysweet
ports:
- "${YSWEET_BIND_PORT:-8080}:8080"
entrypoint: ["y-sweet"]
command:
- "serve"
- "--host"
- "0.0.0.0"
- "--port"
- "8080"
- "--checkpoint-freq-seconds"
- "10"
- "/data"
environment:
- Y_SWEET_OTEL_ENDPOINT=${Y_SWEET_OTEL_ENDPOINT:-http://otel-collector:4318/v1/metrics}
- Y_SWEET_OTEL_SERVICE_NAME=${Y_SWEET_OTEL_SERVICE_NAME:-y-sweet}
- Y_SWEET_OTEL_PUSH_INTERVAL=${Y_SWEET_OTEL_PUSH_INTERVAL:-30}
volumes:
- ysweet_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "bash", "-c", "timeout 5 bash -c '</dev/tcp/localhost/8080'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# PostgreSQL Database
postgres:
build:
context: .
dockerfile: docker/Dockerfile.postgres
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-postgres
shm_size: '512mb'
environment:
POSTGRES_USER: xyne
POSTGRES_PASSWORD: xyne123
POSTGRES_DB: xyne_dev_db
ports:
- "${POSTGRES_BIND_PORT:-5433}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U xyne -d xyne_dev_db"]
interval: 5s
timeout: 5s
retries: 10
start_period: 180s
# Redis
redis:
image: mirror.gcr.io/library/redis:7-alpine
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-redis
ports:
- "${REDIS_BIND_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 60s
# LiveKit Server
livekit:
build:
context: ./docker
dockerfile: Dockerfile.livekit
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-livekit
command: --config /etc/livekit.yaml --dev
ports:
- "${LIVEKIT_HTTP_BIND_PORT:-7880}:7880"
- "${LIVEKIT_HTTPS_BIND_PORT:-7881}:7881"
- "${LIVEKIT_UDP_BIND_PORT:-7882}:7882/udp"
volumes:
- ./docker/livekit.yaml:/etc/livekit.yaml
environment:
- LIVEKIT_API_KEY=localdevkey
- LIVEKIT_API_SECRET=localdevsecret
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-Y", "off", "--spider", "-q", "http://localhost:7880/"]
interval: 5s
timeout: 3s
retries: 5
start_period: 60s
# LiveKit Egress Service (audio recording)
livekit-egress:
image: mirror.gcr.io/livekit/egress:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-livekit-egress
environment:
- EGRESS_CONFIG_FILE=/etc/egress.yaml
- STORAGE_EMULATOR_HOST=http://fake-gcs:4443
volumes:
- ./docker/egress.yaml:/etc/egress.yaml
depends_on:
livekit:
condition: service_healthy
redis:
condition: service_healthy
fake-gcs:
condition: service_healthy
restart: unless-stopped
# Fake GCS Server (local GCS emulator for testing)
fake-gcs:
image: mirror.gcr.io/fsouza/fake-gcs-server:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-fake-gcs
ports:
- "${FAKE_GCS_BIND_PORT:-4443}:4443"
command:
- "-scheme"
- "http"
- "-port"
- "4443"
- "-external-url"
- "http://localhost:4443"
volumes:
- fake_gcs_data:/data
healthcheck:
test: ["CMD", "wget", "-Y", "off", "--spider", "-q", "http://localhost:4443/storage/v1/b"]
interval: 5s
timeout: 3s
retries: 5
start_period: 60s
# MinIO (local S3-compatible storage for testing)
minio:
image: mirror.gcr.io/minio/minio:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-minio
ports:
- "${MINIO_API_BIND_PORT:-9000}:9000"
- "${MINIO_CONSOLE_BIND_PORT:-9001}:9001"
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 3s
retries: 5
start_period: 60s
# Zero Cache Server
zero-cache:
image: mirror.gcr.io/rocicorp/zero:1.9.0
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-zero-cache
# ZERO_AUTH_SECRET is injected from apps/backend/.env.local (gitignored) so the
# backend and zero-cache always share the same secret; never hardcode it here.
env_file:
# Optional: loaded locally (dev has .env.local); absent in CI, where
# .env.test provides the values via docker-compose.test.yml.
- path: ./apps/backend/.env.local
required: false
environment:
- ZERO_UPSTREAM_DB=postgresql://xyne:xyne123@postgres:5432/xyne_dev_db
- ZERO_CVR_DB=postgresql://xyne:xyne123@postgres:5432/xyne_dev_db
- ZERO_CHANGE_DB=postgresql://xyne:xyne123@postgres:5432/xyne_dev_db
- ZERO_REPLICA_FILE=/var/zero/replica.db
- ZERO_LOG_LEVEL=info
- ZERO_ADMIN_PASSWORD=dev-admin-password
- ZERO_MUTATE_URL=http://host.containers.internal:3001/api/zero/push
- ZERO_QUERY_URL=http://host.containers.internal:3001/api/zero/query
- ZERO_QUERY_FORWARD_COOKIES=true
- ZERO_MUTATE_FORWARD_COOKIES=true
- ZERO_CVR_MAX_CONNS=10
- ZERO_UPSTREAM_MAX_CONNS=10
- ZERO_NUM_SYNC_WORKERS=5
- NODE_ENV=development
- ZERO_PORT=4848
# OTEL metrics export
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
- OTEL_RESOURCE_ATTRIBUTES=service.name=zero-cache,service.version=1.9.0
- OTEL_NODE_RESOURCE_DETECTORS=env,host,os
ports:
- "${ZERO_BIND_PORT_1:-4848}:4848"
- "${ZERO_BIND_PORT_2:-4849}:4849"
volumes:
- zero_cache_data:/var/zero
depends_on:
postgres:
condition: service_healthy
extra_hosts:
- "host.containers.internal:host-gateway"
healthcheck:
test: ["CMD", "wget", "-Y", "off", "--spider", "-q", "http://localhost:4848/"]
interval: 5s
timeout: 3s
retries: 10
start_period: 60s
# Python Transcription Agent
transcription-agent:
build:
context: ./apps/backend/python-agent
dockerfile: Dockerfile
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-transcription-agent
shm_size: '512mb'
env_file:
# Optional: loaded locally (dev has .env.local); absent in CI, where
# .env.test provides the values via docker-compose.test.yml.
- path: ./apps/backend/.env.local
required: false
environment:
# Override LIVEKIT_URL to use container hostname instead of localhost
# The python agent will use AGENT_LIVEKIT_URL from .env.local (ws://livekit:7880)
- LIVEKIT_URL=ws://livekit:7880
- LIVEKIT_API_KEY=localdevkey
- LIVEKIT_API_SECRET=localdevsecret
- BACKEND_URL=http://host.containers.internal:3001
- REDIS_URL=redis://redis:6379
- REDIS_HOST=redis
- REDIS_PORT=6379
- STORAGE_EMULATOR_HOST=http://fake-gcs:4443
ports:
- "${TRANSCRIPTION_AGENT_BIND_PORT:-8001}:8080"
volumes:
- ./apps/backend/python-agent/transcriptions:/app/transcriptions
# Mount source code for live development (no rebuild needed)
- ./apps/backend/python-agent:/app
# Persist HuggingFace model cache across container restarts
- transcription-agent-cache:/app/.cache/huggingface
depends_on:
- livekit
- redis
extra_hosts:
- "host.containers.internal:host-gateway"
restart: unless-stopped
# --- OpenTelemetry Collector ---
otel-collector:
image: mirror.gcr.io/otel/opentelemetry-collector-contrib:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-otel-collector
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./docker/dev-infra/configs/otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "${OTEL_HTTP_BIND_PORT:-4318}:4318" # OTLP HTTP receiver (Browser sends here)
- "${OTEL_GRPC_BIND_PORT:-4317}:4317" # OTLP gRPC receiver
- "${OTEL_METRICS_BIND_PORT:-8888}:8888" # Collector metrics
depends_on:
- victoriametrics
restart: unless-stopped
# Victoria Metrics - Metrics Collection
victoriametrics:
image: mirror.gcr.io/victoriametrics/victoria-metrics:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-victoriametrics
ports:
- "${VICTORIAMETRICS_BIND_PORT:-8428}:8428"
command:
- '--storageDataPath=/storage'
- '--httpListenAddr=:8428'
- '--retentionPeriod=12' # Months
- '--promscrape.config=/etc/victoriametrics/scrape.yml'
volumes:
- victoriametrics_data:/storage
- ./scrape.yml:/etc/victoriametrics/scrape.yml
restart: unless-stopped
# Grafana - Metrics Visualization & Dashboards
grafana:
image: mirror.gcr.io/grafana/grafana:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-grafana
ports:
- "${GRAFANA_BIND_PORT:-3333}:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=http://localhost:3333
# VictoriaLogs datasource isn't bundled with core Grafana.
- GF_INSTALL_PLUGINS=victoriametrics-logs-datasource
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=victoriametrics-logs-datasource
volumes:
- grafana_data:/var/lib/grafana
- ./docker/grafana/provisioning:/etc/grafana/provisioning
depends_on:
- victoriametrics
- victorialogs-errors
# Lets webhook contact points (e.g. the Desk alert integration) reach the
# backend running on the host, same as zero-cache's ZERO_MUTATE_URL below.
extra_hosts:
- "host.containers.internal:host-gateway"
restart: unless-stopped
# VictoriaLogs - error-only log instance (fed by Fluent Bit below)
victorialogs-errors:
image: victoriametrics/victoria-logs:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-victorialogs-errors
command:
- '--storageDataPath=/storage'
- '--httpListenAddr=:9428'
- '--retentionPeriod=1' # Month; this instance only holds deduped errors
ports:
- "${VICTORIALOGS_ERRORS_BIND_PORT:-9428}:9428"
volumes:
- victorialogs_errors_data:/storage
restart: unless-stopped
# Fluent Bit - receives backend error logs over the Fluentd forward
# protocol (streamed directly from Winston, see apps/backend/src/utils/logger.ts),
# normalizes + hashes them via the Lua filter, and forwards them to the
# victorialogs-errors instance above.
fluent-bit:
image: fluent/fluent-bit:3.1
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-fluent-bit
volumes:
- ./docker/fluent-bit/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf
- ./docker/fluent-bit/normalize_hash.lua:/fluent-bit/etc/normalize_hash.lua
ports:
- "${FLUENT_BIT_HTTP_BIND_PORT:-2020}:2020" # Fluent Bit metrics/health
# Backend runs on the host in local dev, so it connects to this forward
# input over localhost (LOG_FLUENT_HOST/LOG_FLUENT_PORT in .env.local).
- "${FLUENT_BIT_FORWARD_BIND_PORT:-24224}:24224"
depends_on:
- victorialogs-errors
restart: unless-stopped
# Superposition - Feature Flag & Configuration Management
superposition:
image: ghcr.io/juspay/superposition-demo:latest
container_name: ${COMPOSE_PROJECT_NAME:-xyne}-superposition
ports:
- "${SUPERPOSITION_BIND_PORT:-9999}:8080"
environment:
- SUPERPOSITION_TOKEN=123456
- SUPERPOSITION_ORG_ID=localorg
- SUPERPOSITION_WORKSPACE_ID=test
- REDIS_URL=redis://redis:6379
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "--noproxy", "*", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
# Backend API - NOW RUNS LOCALLY (see apps/backend/.env.local)
# Uncomment if you want to run backend in Docker instead of locally
# backend:
# build:
# context: .
# dockerfile: ./docker/Dockerfile.backend.dev
# container_name: xyne-backend
# ... (rest of config omitted)
# Dashboard (Frontend) - NOW RUNS LOCALLY (see apps/dashboard/.env.local)
# Uncomment if you want to run dashboard in Docker instead of locally
# dashboard:
# build:
# context: .
# dockerfile: ./docker/Dockerfile.dashboard.dev
# container_name: xyne-dashboard
# ... (rest of config omitted)
volumes:
ysweet_data:
driver: local
postgres_data:
driver: local
redis_data:
driver: local
zero_cache_data:
driver: local
fake_gcs_data:
driver: local
victoriametrics_data:
driver: local
victorialogs_errors_data:
driver: local
grafana_data:
driver: local
minio_data:
driver: local
transcription-agent-cache:
driver: local