-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
172 lines (163 loc) · 5.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
172 lines (163 loc) · 5.48 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
# StackFlow — infrastructure services
# Langfuse v3 (observability) + PostgreSQL (shared) + supporting services.
# API and editor run locally for full tool access.
#
# Usage:
# docker compose up -d # start infra
# docker compose down # stop (keeps data)
# docker compose down -v # stop and wipe all data
#
# Langfuse: http://localhost:3000 (admin@stackflow.local / adminadmin)
# PostgreSQL: localhost:5432 (postgres / postgres)
services:
# ── Langfuse v3 ──────────────────────────────────────────────────────
langfuse-web:
image: docker.io/langfuse/langfuse:3
restart: always
depends_on: &langfuse-deps
postgres:
condition: service_healthy
minio:
condition: service_healthy
redis:
condition: service_healthy
clickhouse:
condition: service_healthy
ports:
- 3000:3000
environment: &langfuse-env
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: stackflow-local-secret
SALT: stackflow-local-salt
ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000"
TELEMETRY_ENABLED: "false"
CLICKHOUSE_MIGRATION_URL: clickhouse://clickhouse:9000
CLICKHOUSE_URL: http://clickhouse:8123
CLICKHOUSE_USER: clickhouse
CLICKHOUSE_PASSWORD: clickhouse
CLICKHOUSE_CLUSTER_ENABLED: "false"
REDIS_HOST: redis
REDIS_PORT: "6379"
REDIS_AUTH: redispass
REDIS_TLS_ENABLED: "false"
LANGFUSE_S3_EVENT_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: http://minio:9000
LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: minio
LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: miniosecret
LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: "true"
LANGFUSE_S3_EVENT_UPLOAD_REGION: auto
LANGFUSE_S3_EVENT_UPLOAD_PREFIX: "events/"
LANGFUSE_S3_MEDIA_UPLOAD_BUCKET: langfuse
LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT: http://localhost:9090
LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID: minio
LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY: miniosecret
LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE: "true"
LANGFUSE_S3_MEDIA_UPLOAD_REGION: auto
LANGFUSE_S3_MEDIA_UPLOAD_PREFIX: "media/"
LANGFUSE_S3_BATCH_EXPORT_ENABLED: "false"
LANGFUSE_USE_AZURE_BLOB: "false"
# Headless init — auto-create org, project, API keys, admin user
LANGFUSE_INIT_ORG_ID: stackflow
LANGFUSE_INIT_ORG_NAME: StackFlow
LANGFUSE_INIT_PROJECT_ID: stackflow
LANGFUSE_INIT_PROJECT_NAME: StackFlow
LANGFUSE_INIT_PROJECT_PUBLIC_KEY: pk-lf-local
LANGFUSE_INIT_PROJECT_SECRET_KEY: sk-lf-local
LANGFUSE_INIT_USER_EMAIL: admin@stackflow.local
LANGFUSE_INIT_USER_NAME: Admin
LANGFUSE_INIT_USER_PASSWORD: adminadmin
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://$(hostname):3000/api/public/health || exit 1"]
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
langfuse-worker:
image: docker.io/langfuse/langfuse-worker:3
restart: always
depends_on: *langfuse-deps
ports:
- 127.0.0.1:3030:3030
environment:
<<: *langfuse-env
# ── Shared infrastructure ────────────────────────────────────────────
postgres:
image: docker.io/postgres:17-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
TZ: UTC
PGTZ: UTC
ports:
- 127.0.0.1:5432:5432
volumes:
- pgdata:/var/lib/postgresql/data
- ./docker/init-stackflow-db.sql:/docker-entrypoint-initdb.d/init-stackflow-db.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
timeout: 3s
retries: 10
clickhouse:
image: docker.io/clickhouse/clickhouse-server
restart: always
user: "101:101"
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
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
interval: 5s
timeout: 5s
retries: 10
start_period: 1s
redis:
image: docker.io/redis:7-alpine
restart: always
command: >
--requirepass redispass
--maxmemory-policy noeviction
ports:
- 127.0.0.1:6379:6379
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "redispass", "ping"]
interval: 3s
timeout: 10s
retries: 10
minio:
image: cgr.dev/chainguard/minio
restart: always
entrypoint: sh
command: -c 'mkdir -p /data/langfuse && minio server --address ":9000" --console-address ":9001" /data'
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: miniosecret
ports:
- 9090:9000
- 127.0.0.1:9091:9001
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 1s
timeout: 5s
retries: 5
start_period: 1s
volumes:
pgdata:
clickhouse_data:
clickhouse_logs:
redis_data:
minio_data: