-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathlangfuse-stack.yml
More file actions
129 lines (121 loc) · 4.4 KB
/
langfuse-stack.yml
File metadata and controls
129 lines (121 loc) · 4.4 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
# ------------------------------------------------------------
# Langfuse v3 self-host stack for Hermes
# ------------------------------------------------------------
# Spins up Langfuse (web + worker), Postgres, Redis, ClickHouse, MinIO.
# Paired with a Caddyfile (templates/caddy/Caddyfile) to expose https.
#
# Usage:
# cp .env.langfuse.example .env.langfuse
# # edit .env.langfuse (generate fresh secrets!)
# docker compose -f templates/compose/langfuse-stack.yml --env-file .env.langfuse up -d
#
# Recommended sizing: 4GB RAM, 2 vCPU minimum. Hetzner CX22 works.
# ------------------------------------------------------------
version: "3.8"
services:
langfuse-web:
image: langfuse/langfuse:3
restart: unless-stopped
depends_on:
postgres: { condition: service_healthy }
clickhouse: { condition: service_healthy }
minio: { condition: service_healthy }
redis: { condition: service_healthy }
ports:
- "127.0.0.1:3000:3000"
environment:
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
DIRECT_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
NEXTAUTH_URL: ${NEXTAUTH_URL}
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
SALT: ${SALT}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
CLICKHOUSE_MIGRATION_URL: clickhouse://clickhouse:9000
CLICKHOUSE_URL: http://clickhouse:8123
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
LANGFUSE_S3_EVENT_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_EVENT_UPLOAD_REGION: auto
LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: ${MINIO_ROOT_USER}
LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD}
LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: http://minio:9000
LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: "true"
REDIS_CONNECTION_STRING: redis://default:${REDIS_PASSWORD}@redis:6379
langfuse-worker:
image: langfuse/langfuse-worker:3
restart: unless-stopped
depends_on:
postgres: { condition: service_healthy }
clickhouse: { condition: service_healthy }
minio: { condition: service_healthy }
redis: { condition: service_healthy }
environment:
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
CLICKHOUSE_URL: http://clickhouse:8123
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
CLICKHOUSE_MIGRATION_URL: clickhouse://clickhouse:9000
LANGFUSE_S3_EVENT_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_EVENT_UPLOAD_REGION: auto
LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: ${MINIO_ROOT_USER}
LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD}
LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: http://minio:9000
LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: "true"
REDIS_CONNECTION_STRING: redis://default:${REDIS_PASSWORD}@redis:6379
SALT: ${SALT}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
clickhouse:
image: clickhouse/clickhouse-server:24
restart: unless-stopped
environment:
CLICKHOUSE_DB: default
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
volumes:
- chdata:/var/lib/clickhouse
- chlogs:/var/log/clickhouse-server
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8123/ping || exit 1"]
interval: 5s
timeout: 5s
retries: 20
minio:
image: minio/minio:latest
restart: unless-stopped
command: ["server", "/data", "--console-address", ":9001"]
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
volumes:
- miniodata:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
healthcheck:
test: ["CMD", "redis-cli", "--raw", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 5s
timeout: 5s
retries: 10
volumes:
pgdata:
chdata:
chlogs:
miniodata: