-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
268 lines (257 loc) · 9.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
268 lines (257 loc) · 9.03 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
services:
postgres:
image: pgvector/pgvector:pg15
container_name: template-postgres
restart: unless-stopped
environment:
POSTGRES_DB: application
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5436:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d application"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
minio:
image: minio/minio:latest
container_name: template-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9002:9000"
- "9003:9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
minio-init:
image: minio/mc:latest
container_name: template-minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb local/uploads --ignore-existing;
mc anonymous set download local/uploads;
exit 0;
"
mailhog:
image: mailhog/mailhog:latest
platform: linux/amd64
container_name: template-mailhog
restart: unless-stopped
ports:
- "1025:1025"
- "8025:8025"
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8025 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# OPT-IN: behind the `langfuse` Compose profile, so `./gradlew devUp` stays lean.
# Bring it up with `./gradlew devUpLangfuse` (or `docker compose --profile langfuse up -d --wait`).
# Only langfuse-web publishes a host port (3000); clickhouse/redis/postgres/minio stay internal
# (no published ports → no clash with the app's MinIO on 9000/9001). The stack is fully
# self-contained (its own langfuse-minio) so it never collides with the app's shared services.
# The SALT / ENCRYPTION_KEY / NEXTAUTH_SECRET / *_PASSWORD below are LOCAL-DEV values —
# regenerate them (e.g. `openssl rand -hex 32`) for any non-local deployment.
# ───────────────────────────────────────────────────────────────────────────
langfuse-postgres:
image: postgres:16
container_name: template-langfuse-postgres
profiles: ["langfuse"]
restart: unless-stopped
environment:
POSTGRES_DB: langfuse
POSTGRES_USER: langfuse
POSTGRES_PASSWORD: langfuse
volumes:
- langfuse_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U langfuse -d langfuse"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
langfuse-clickhouse:
image: clickhouse/clickhouse-server:24.12
container_name: template-langfuse-clickhouse
profiles: ["langfuse"]
restart: unless-stopped
user: "101:101"
environment:
CLICKHOUSE_DB: default
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: clickhouse
volumes:
- langfuse_clickhouse_data:/var/lib/clickhouse
- langfuse_clickhouse_logs:/var/log/clickhouse-server
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
langfuse-redis:
image: redis:7
container_name: template-langfuse-redis
profiles: ["langfuse"]
restart: unless-stopped
command: ["redis-server", "--requirepass", "langfuse"]
healthcheck:
test: ["CMD", "redis-cli", "-a", "langfuse", "ping"]
interval: 10s
timeout: 5s
retries: 10
start_period: 5s
# Dedicated blob storage for Langfuse (event/media uploads). Kept SEPARATE from the app's `minio`
# so the langfuse profile is fully self-contained — it never collides with, or depends on, the
# app's shared services (which may be owned by a different Compose project on the same machine).
langfuse-minio:
image: minio/minio:latest
container_name: template-langfuse-minio
profiles: ["langfuse"]
restart: unless-stopped
command: server /data
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- langfuse_minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
langfuse-minio-init:
image: minio/mc:latest
container_name: template-langfuse-minio-init
profiles: ["langfuse"]
depends_on:
langfuse-minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://langfuse-minio:9000 minioadmin minioadmin;
mc mb local/langfuse --ignore-existing;
exit 0;
"
langfuse-worker:
image: langfuse/langfuse-worker:3
container_name: template-langfuse-worker
profiles: ["langfuse"]
restart: unless-stopped
depends_on:
langfuse-postgres:
condition: service_healthy
langfuse-clickhouse:
condition: service_healthy
langfuse-redis:
condition: service_healthy
langfuse-minio:
condition: service_healthy
langfuse-minio-init:
condition: service_completed_successfully
environment:
DATABASE_URL: postgresql://langfuse:langfuse@langfuse-postgres:5432/langfuse
NEXTAUTH_URL: http://localhost:3000
SALT: template-local-dev-salt
ENCRYPTION_KEY: "3e3ca4d97022cad63b65b90ef4dd1cf5b4c287a948be075ff71fa6d62bf4bd27"
TELEMETRY_ENABLED: "false"
CLICKHOUSE_MIGRATION_URL: clickhouse://langfuse-clickhouse:9000
CLICKHOUSE_URL: http://langfuse-clickhouse:8123
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: clickhouse
CLICKHOUSE_CLUSTER_ENABLED: "false"
REDIS_HOST: langfuse-redis
REDIS_PORT: "6379"
REDIS_AUTH: langfuse
LANGFUSE_S3_EVENT_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_EVENT_UPLOAD_REGION: us-east-1
LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: http://langfuse-minio:9000
LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: minioadmin
LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: minioadmin
LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: "true"
LANGFUSE_S3_EVENT_UPLOAD_PREFIX: events/
langfuse-web:
image: langfuse/langfuse:3
container_name: template-langfuse-web
profiles: ["langfuse"]
restart: unless-stopped
depends_on:
langfuse-postgres:
condition: service_healthy
langfuse-clickhouse:
condition: service_healthy
langfuse-redis:
condition: service_healthy
langfuse-minio:
condition: service_healthy
langfuse-minio-init:
condition: service_completed_successfully
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://langfuse:langfuse@langfuse-postgres:5432/langfuse
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: template-local-dev-nextauth-secret
SALT: template-local-dev-salt
ENCRYPTION_KEY: "3e3ca4d97022cad63b65b90ef4dd1cf5b4c287a948be075ff71fa6d62bf4bd27"
TELEMETRY_ENABLED: "false"
CLICKHOUSE_MIGRATION_URL: clickhouse://langfuse-clickhouse:9000
CLICKHOUSE_URL: http://langfuse-clickhouse:8123
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: clickhouse
CLICKHOUSE_CLUSTER_ENABLED: "false"
REDIS_HOST: langfuse-redis
REDIS_PORT: "6379"
REDIS_AUTH: langfuse
LANGFUSE_S3_EVENT_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_EVENT_UPLOAD_REGION: us-east-1
LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: http://langfuse-minio:9000
LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: minioadmin
LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: minioadmin
LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: "true"
LANGFUSE_S3_EVENT_UPLOAD_PREFIX: events/
# Headless init — pins the org/project/API keys + 90-day retention on first boot.
# The same keys go in the app .env (LANGFUSE_PUBLIC_KEY/SECRET_KEY) → no manual UI step.
LANGFUSE_INIT_ORG_ID: template
LANGFUSE_INIT_ORG_NAME: Template
LANGFUSE_INIT_PROJECT_ID: template-dev
LANGFUSE_INIT_PROJECT_NAME: Template Dev
LANGFUSE_INIT_PROJECT_PUBLIC_KEY: pk-lf-local-dev
LANGFUSE_INIT_PROJECT_SECRET_KEY: sk-lf-local-dev
LANGFUSE_INIT_PROJECT_RETENTION: "90"
LANGFUSE_INIT_USER_EMAIL: dev@example.com
LANGFUSE_INIT_USER_NAME: Dev
LANGFUSE_INIT_USER_PASSWORD: langfuse-dev-password
volumes:
langfuse_postgres_data:
langfuse_clickhouse_data:
langfuse_clickhouse_logs:
langfuse_minio_data:
postgres_data:
driver: local
minio_data:
driver: local