-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
412 lines (390 loc) · 13.7 KB
/
docker-compose.yml
File metadata and controls
412 lines (390 loc) · 13.7 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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
networks:
conserver:
external: true
# ── Profiles ────────────────────────────────────────────────────────────────
# Set COMPOSE_PROFILES in your .env to control which optional services start.
# Available profiles: postgres, elasticsearch, langfuse
#
# redis is always required — conserver and api depend on it.
#
# COMPOSE_PROFILES=postgres # local postgres, no elasticsearch
# COMPOSE_PROFILES=postgres,langfuse # local postgres + Langfuse for tracing
# COMPOSE_PROFILES= # redis only (use external DB + no tracing)
services:
conserver:
build:
dockerfile: ./docker/Dockerfile
context: .
# image: vcon-server-enterprise:latest
command: "watchmedo auto-restart -p '*.py' -R -- opentelemetry-instrument python ./conserver/main.py"
volumes:
- .:/app
- ./config.yml:/app/config.yml
depends_on:
redis:
condition: service_healthy
env_file:
- .env
environment:
- OTEL_SERVICE_NAME=conserver
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-}
- OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL:-grpc}
- OTEL_EXPORTER_OTLP_INSECURE=${OTEL_EXPORTER_OTLP_INSECURE:-false}
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS:-}
- OTEL_RESOURCE_ATTRIBUTES=deployment.environment=dev
stop_grace_period: 5s
networks:
- conserver
labels:
- "com.datadoghq.ad.check_names=['python']"
- "com.datadoghq.ad.init_configs=[{}]"
- "com.datadoghq.ad.instances=[{'python_service': 'conserver.main'}]"
api:
build:
dockerfile: ./docker/Dockerfile
context: .
command: /bin/bash -c "opentelemetry-instrument uvicorn api:app --host 0.0.0.0 --port 8000"
volumes:
- .:/app
ports:
- "${CONSERVER_EXTERNAL_PORT:-8000}:8000"
depends_on:
redis:
condition: service_healthy
env_file:
- .env
environment:
- OTEL_SERVICE_NAME=api
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-}
- OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL:-grpc}
- OTEL_EXPORTER_OTLP_INSECURE=${OTEL_EXPORTER_OTLP_INSECURE:-false}
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS:-}
- OTEL_RESOURCE_ATTRIBUTES=deployment.environment=dev
networks:
- conserver
labels: []
# - "traefik.enable=true"
# - "traefik.http.routers.api.rule=Host(`${DNS_HOST}`) && PathPrefix(`/api`)"
# - "traefik.http.routers.api.entrypoints=websecure"
# - "traefik.http.routers.api.tls.certresolver=myresolver"
# - "traefik.http.services.api.loadbalancer.server.port=8000"
# - "traefik.http.middlewares.strip-api-prefix.stripprefix.prefixes=/api"
# - "com.datadoghq.ad.check_names=['python']"
# - "com.datadoghq.ad.init_configs=[{}]"
# - "com.datadoghq.ad.instances=[{'python_service': 'conserver.api'}]"
redis:
image: "redis/redis-stack:latest"
ports:
- "${REDIS_EXTERNAL_PORT:-8001}:8001"
environment:
REDIS_ARGS: --save 20 1 --notify-keyspace-events Ex --dir /data --appendonly yes
mem_limit: 1gb
volumes:
- redis_data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 30s
timeout: 10s
retries: 5
networks:
- conserver
labels:
- "com.datadoghq.ad.check_names=['conserver.redis']"
- "com.datadoghq.ad.init_configs=[{}]"
- "com.datadoghq.ad.instances=[{'host': 'redis', 'port': 6379}]"
postgres:
profiles: [postgres]
image: postgres:alpine
ports:
- "5432:5432"
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- conserver
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 10s
retries: 5
elasticsearch:
profiles: [elasticsearch]
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.4
environment:
- discovery.type=single-node
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=changeme
- xpack.security.enabled=true
- xpack.security.transport.ssl.enabled=false
- xpack.security.http.ssl.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ports:
- "9200:9200"
- "9300:9300"
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
- conserver
healthcheck:
test: ["CMD-SHELL", "curl -u elastic:changeme -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"\\|\"status\":\"yellow\"'"]
interval: 30s
timeout: 10s
retries: 5
# Uncomment the below to include the `JLINC` link functionality
# -------------------------------------------------------------
#
# jlinc-server:
# image: registry.jlinc.io/jlinc-server
# environment:
# # BASE CONFIGURATION
# # ==================
# # If you wish to display debug logging
# # DEBUG: "true"
# #
# # DB URL
# POSTGRES_URL: postgresql://jlinc:password@jlinc-db/jlinc
# # Public URLs, callback URLS will be PUBLIC_CALLBACK_URL + '/callback/<module>'
# PUBLIC_CORE_URL: http://localhost:9090
# PUBLIC_ARCHIVE_URL: http://localhost:9090
# PUBLIC_CALLBACK_URL: http://localhost:9090
# # Enabled app modules
# APP_MODULES: core, archive
# # Enabled authentication modules
# AUTH_MODULES: oidc, github, google
# # Secure secret for memory store, generate with `openssl rand -hex 64`
# SECURE_SECRET: 9ed678e6da3333a53c635039a5f53015ba3d4c841a0ade4e46f31c2d42c9b3e71edcdda7e1d75d066a39a8f56f9eb325d556a90195c6e7f45c6e2fffd0e98a7a
# # Default FedID server to use for identity management
# DEFAULT_FEDID_URL: http://fedid-server:8881
# # AUTH MODULES
# # ============
# # OpenID Connect
# # --------------
# # Works with any OIDC provider
# # OIDC_CLIENT_ID:
# # OIDC_CLIENT_SECRET:
# # OIDC_ISSUER: https://fedid-test.jlinc.io/oidc
# # OIDC_AUTHORIZATION_URL: https://fedid-test.jlinc.io/oidc/auth
# # OIDC_TOKEN_URL: https://fedid-test.jlinc.io/oidc/token
# # OIDC_USERINFO_URL: https://fedid-test.jlinc.io/oidc/me
# # OIDC_LOGOUT_URL: https://fedid-test.jlinc.io/oidc/session/end
# # GitHub
# # --------------
# # Set up your GitHub app: https://github.com/settings/applications/new
# # GITHUB_CLIENT_ID:
# # GITHUB_CLIENT_SECRET:
# # Google
# # --------------
# # Set up your Google app: https://console.developers.google.com/
# # - Create a new app
# # - Set up auth: https://console.cloud.google.com/auth/overview
# # GOOGLE_CLIENT_ID:
# # GOOGLE_CLIENT_SECRET:
# restart: unless-stopped
# depends_on:
# - jlinc-db
# networks:
# - conserver
# # For dev
# ports:
# - 9090:9090
# jlinc-db:
# image: postgres:17-alpine
# environment:
# - POSTGRES_USER=jlinc
# - POSTGRES_PASSWORD=password
# - POSTGRES_DB=jlinc
# volumes:
# - ./.data/jlinc-db:/var/lib/postgresql/data
# restart: unless-stopped
# networks:
# - conserver
# fedid-server:
# image: registry.jlinc.io/fedid-server
# environment:
# CONFIG: '{
# "publicUrl": "http://fedid-server:8881",
# "port": 8881,
# "schema": "http",
# "primaryDomain": "vcon.local",
# "domains": [
# "vcon.local"
# ],
# "dbUrl": "postgresql://fedid:password@fedid-db/fedid",
# "redisUrl": "redis://fedid-redis:6379",
# "allowInsecure": true
# }'
# restart: unless-stopped
# depends_on:
# - fedid-db
# - fedid-redis
# networks:
# - conserver
# fedid-db:
# image: postgres:15-alpine
# hostname: postgres
# environment:
# - POSTGRES_USER=fedid
# - POSTGRES_PASSWORD=password
# - POSTGRES_DB=fedid
# volumes:
# - ./.data/fedid-db:/var/lib/postgresql/data
# restart: unless-stopped
# networks:
# - conserver
# fedid-redis:
# image: redis
# healthcheck:
# test: ["CMD", "redis-cli", "ping"]
# interval: 10s
# timeout: 30s
# retries: 3
# networks:
# - conserver
# ── Langfuse (optional — profile: langfuse) ───────────────────────────────
# Local LLM observability for dev/testing. Langfuse v3 (latest).
# Pre-seeded credentials (dev only — never use these in production):
# UI: http://localhost:3000
# Email: admin@langfuse.local
# Password: admin1234
# Public key: pk-lf-localdev
# Secret key: sk-lf-localdev
# Set these in .env to route traces here:
# OTEL_EXPORTER_OTLP_ENDPOINT=http://langfuse-server:3000/api/public/otel
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic cGstbGYtbG9jYWxkZXY6c2stbGYtbG9jYWxkZXY=
langfuse-server:
profiles: [langfuse]
image: langfuse/langfuse:latest
ports:
- "3000:3000"
depends_on:
langfuse-postgres:
condition: service_healthy
langfuse-clickhouse:
condition: service_healthy
langfuse-minio:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://postgres:postgres@langfuse-postgres:5432/langfuse
- CLICKHOUSE_MIGRATION_URL=clickhouse://langfuse-clickhouse:9000
- CLICKHOUSE_URL=http://langfuse-clickhouse:8123
- CLICKHOUSE_USER=clickhouse
- CLICKHOUSE_PASSWORD=clickhouse
- REDIS_HOST=redis
- REDIS_PORT=6379
- NEXTAUTH_URL=http://localhost:3000
- NEXTAUTH_SECRET=dev-nextauth-secret-not-for-production
- SALT=dev-salt-not-for-production
- ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000
- TELEMETRY_ENABLED=false
- LANGFUSE_S3_EVENT_UPLOAD_ENABLED=true
- LANGFUSE_S3_EVENT_UPLOAD_BUCKET=langfuse
- LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID=minio
- LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY=miniopassword
- LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT=http://langfuse-minio:9000
- LANGFUSE_S3_EVENT_UPLOAD_REGION=auto
- LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE=true
- LANGFUSE_INIT_ORG_ID=default
- LANGFUSE_INIT_ORG_NAME=vconic
- LANGFUSE_INIT_PROJECT_ID=vcon-server
- LANGFUSE_INIT_PROJECT_NAME=vcon-server
- LANGFUSE_INIT_PROJECT_PUBLIC_KEY=pk-lf-localdev
- LANGFUSE_INIT_PROJECT_SECRET_KEY=sk-lf-localdev
- LANGFUSE_INIT_USER_EMAIL=admin@langfuse.local
- LANGFUSE_INIT_USER_NAME=admin
- LANGFUSE_INIT_USER_PASSWORD=admin1234
networks:
- conserver
langfuse-worker:
profiles: [langfuse]
image: langfuse/langfuse-worker:latest
depends_on:
langfuse-postgres:
condition: service_healthy
langfuse-clickhouse:
condition: service_healthy
langfuse-minio:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://postgres:postgres@langfuse-postgres:5432/langfuse
- CLICKHOUSE_MIGRATION_URL=clickhouse://langfuse-clickhouse:9000
- CLICKHOUSE_URL=http://langfuse-clickhouse:8123
- CLICKHOUSE_USER=clickhouse
- CLICKHOUSE_PASSWORD=clickhouse
- REDIS_HOST=redis
- REDIS_PORT=6379
- SALT=dev-salt-not-for-production
- ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000
- TELEMETRY_ENABLED=false
- LANGFUSE_S3_EVENT_UPLOAD_ENABLED=true
- LANGFUSE_S3_EVENT_UPLOAD_BUCKET=langfuse
- LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID=minio
- LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY=miniopassword
- LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT=http://langfuse-minio:9000
- LANGFUSE_S3_EVENT_UPLOAD_REGION=auto
- LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE=true
networks:
- conserver
langfuse-minio:
profiles: [langfuse]
image: minio/minio
entrypoint: sh
command: -c 'mkdir -p /data/langfuse && minio server /data --console-address ":9001"'
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: miniopassword
volumes:
- langfuse_minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
networks:
- conserver
langfuse-clickhouse:
profiles: [langfuse]
image: clickhouse/clickhouse-server:24.12
environment:
CLICKHOUSE_DB: default
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: clickhouse
volumes:
- langfuse_clickhouse_data:/var/lib/clickhouse
- langfuse_clickhouse_logs:/var/log/clickhouse-server
- ./docker/clickhouse/keeper.xml:/etc/clickhouse-server/config.d/keeper.xml:ro
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping
interval: 5s
timeout: 5s
retries: 10
networks:
- conserver
langfuse-postgres:
profiles: [langfuse]
image: postgres:alpine
environment:
POSTGRES_DB: langfuse
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- langfuse_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- conserver
volumes:
es_data: {}
redis_data: {}
postgres_data: {}
langfuse_postgres_data: {}
langfuse_clickhouse_data: {}
langfuse_clickhouse_logs: {}
langfuse_minio_data: {}