-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
193 lines (185 loc) · 5.85 KB
/
docker-compose.yml
File metadata and controls
193 lines (185 loc) · 5.85 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
services:
postgres:
image: timescale/timescaledb-ha:pg17
# diskann (pgvectorscale) graph builds and REINDEX use maintenance_work_mem;
# the default 64MB makes them painfully slow.
command: postgres -c maintenance_work_mem=2GB
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASS:-changeme}
POSTGRES_MULTIPLE_DATABASES: langfuse
TZ: UTC
PGTZ: UTC
volumes:
- postgres:/home/postgres/pgdata
# NOTE: Only runs on first volume creation
- ./init-dbs.sh:/docker-entrypoint-initdb.d/init-dbs.sh
ports:
- '${POSTGRES_PORT:-5432}:5432'
networks:
- app
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-postgres}']
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:8
command: >
--requirepass ${REDIS_PASS:-changeme}
--maxmemory-policy noeviction
ports:
- '${REDIS_PORT:-6379}:6379'
volumes:
- redis:/data
networks:
- app
restart: unless-stopped
healthcheck:
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
interval: 5s
timeout: 3s
retries: 10
app:
build: .
environment:
- TZ=UTC
- POSTGRES_URL=${POSTGRES_URL}
- REDIS_URL=redis://:${REDIS_PASS}@redis:6379
- APP_FRONTEND_URL=${APP_FRONTEND_URL}
- APP_SESSION_SECRET=${APP_SESSION_SECRET:-super_secret_value}
- APP_SESSION_EXPIRY_HOURS=${APP_SESSION_EXPIRY_HOURS:-336}
- PLATFORM_MODEL_ENABLED=${PLATFORM_MODEL_ENABLED:-false}
- LLM_PLATFORM_MODEL=${LLM_PLATFORM_MODEL:-gemini-2.5-flash}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-false}
- LANGFUSE_ENABLED=${LANGFUSE_ENABLED:-false}
- LANGFUSE_PUBLIC_KEY=${LANGFUSE_PUBLIC_KEY:-}
- LANGFUSE_SECRET_KEY=${LANGFUSE_SECRET_KEY:-}
- LANGFUSE_BASE_URL=${LANGFUSE_BASE_URL:-http://langfuse-web:3000}
- OTEL_CONSOLE_EXPORT_ENABLED=${OTEL_CONSOLE_EXPORT_ENABLED:-false}
ports:
- '${APP_PORT:-3333}:3333'
networks:
- app
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
clickhouse:
image: clickhouse/clickhouse-server
user: '101:101'
profiles: [observability]
environment:
CLICKHOUSE_DB: default
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: clickhouse
volumes:
- clickhouse_data:/var/lib/clickhouse
- clickhouse_logs:/var/log/clickhouse-server
ports:
- '127.0.0.1:8123:8123'
- '127.0.0.1:9000:9000'
networks:
- app
restart: unless-stopped
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
interval: 5s
timeout: 3s
retries: 10
start_period: 1s
minio:
image: cgr.dev/chainguard/minio
profiles: [observability]
entrypoint: sh
# Create the 'langfuse' bucket before starting MinIO.
command: -c 'mkdir -p /data/langfuse && minio server --address ":9000" --console-address ":9001" /data'
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: miniosecret
volumes:
- minio_data:/data
ports:
- '127.0.0.1:9090:9000'
- '127.0.0.1:9091:9001'
networks:
- app
restart: unless-stopped
healthcheck:
test: ['CMD', 'mc', 'ready', 'local']
interval: 1s
timeout: 5s
retries: 5
start_period: 1s
langfuse-worker:
image: langfuse/langfuse-worker:3
profiles: [observability]
environment: &langfuse-env # Shared Postgres, dedicated database
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASS:-changeme}@postgres:5432/langfuse
# Shared Redis, dedicated logical DB index
REDIS_CONNECTION_STRING: redis://:${REDIS_PASS:-changeme}@redis:6379/1
# Dedicated ClickHouse
CLICKHOUSE_URL: http://clickhouse:8123
CLICKHOUSE_MIGRATION_URL: clickhouse://clickhouse:9000
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: clickhouse
CLICKHOUSE_CLUSTER_ENABLED: 'false'
# MinIO (S3-compatible) for events + media
LANGFUSE_S3_EVENT_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_EVENT_UPLOAD_REGION: auto
LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: minio
LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: miniosecret
LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: http://minio:9000
LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: 'true'
LANGFUSE_S3_EVENT_UPLOAD_PREFIX: events/
LANGFUSE_S3_MEDIA_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_MEDIA_UPLOAD_REGION: auto
LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID: minio
LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY: miniosecret
LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT: http://minio:9000
LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE: 'true'
LANGFUSE_S3_MEDIA_UPLOAD_PREFIX: media/
# Dev-only literals - never used outside local dev
NEXTAUTH_URL: http://localhost:3334
SALT: dev-salt
ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000'
TELEMETRY_ENABLED: 'false'
ports:
- '127.0.0.1:3030:3030'
networks:
- app
restart: unless-stopped
depends_on: &langfuse-depends-on
postgres:
condition: service_healthy
redis:
condition: service_healthy
clickhouse:
condition: service_healthy
minio:
condition: service_healthy
langfuse-web:
image: langfuse/langfuse:3
profiles: [observability]
environment:
<<: *langfuse-env
NEXTAUTH_SECRET: dev-nextauth-secret
ports:
- '3334:3000'
networks:
- app
restart: unless-stopped
depends_on: *langfuse-depends-on
networks:
app:
driver: bridge
volumes:
postgres:
redis:
clickhouse_data:
clickhouse_logs:
minio_data: