-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
594 lines (548 loc) · 18 KB
/
docker-compose.dev.yml
File metadata and controls
594 lines (548 loc) · 18 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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
#
# docker-compose file used ONLY for local development.
# For more info, see:
# https://posthog.com/handbook/engineering/developing-locally
#
# PostHog has sunset support for self-hosted K8s deployments.
# See: https://posthog.com/blog/sunsetting-helm-support-posthog
#
services:
proxy:
extends:
file: docker-compose.base.yml
service: proxy
ports:
- 127.0.0.1:8010:8000
extra_hosts:
- 'web:host-gateway'
- 'plugins:host-gateway'
- 'capture:host-gateway'
- 'capture-ai:host-gateway'
- 'replay-capture:host-gateway'
- 'feature-flags:host-gateway'
environment:
CADDYFILE: |
http://localhost:8000 {
@replay-capture {
path /s
path /s/*
}
@capture-ai {
path /i/v0/ai
path /i/v0/ai/*
}
@capture {
path /e
path /e/*
path /i/v0/*
path /batch
path /batch*
path /capture
path /capture*
}
@capture-logs {
path /i/v1/logs
}
@flags {
path /flags
path /flags*
}
@webhooks {
path /public/webhooks
path /public/webhooks/*
path /public/m
path /public/m/*
}
handle @capture-ai {
reverse_proxy capture-ai:3309
}
handle @capture {
reverse_proxy capture:3307
}
handle @capture-logs {
reverse_proxy capture-logs:4318
}
handle @replay-capture {
reverse_proxy replay-capture:3306
}
handle @flags {
reverse_proxy feature-flags:3001
}
handle @webhooks {
reverse_proxy plugins:6738
}
handle {
reverse_proxy web:8000
}
}
capture:
extends:
file: docker-compose.base.yml
service: capture
restart: on-failure
ports:
- '3307:3000'
depends_on:
kafka:
condition: service_healthy
redis7:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/_liveness']
interval: 5s
timeout: 5s
retries: 24
start_period: 10s
profiles:
- capture
plugins:
extends:
file: docker-compose.base.yml
service: plugins
image: ghcr.io/posthog/posthog-node:${POSTHOG_NODE_TAG:-master}
ports:
- '6738:6738'
environment:
DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_DB_NAME:-posthog}
PERSONS_DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_PERSONS_DB_NAME:-posthog}
CLICKHOUSE_DATABASE: ${CLICKHOUSE_DATABASE:-posthog}
# CDP Redis defaults to 127.0.0.1 — must point to the Docker service
CDP_REDIS_HOST: redis7
# Encryption keys default is only set when NODE_ENV=dev, but the image uses production
ENCRYPTION_SALT_KEYS: '00beef0000beef0000beef0000beef00'
depends_on:
kafka:
condition: service_started
redis7:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6738/_ready']
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
profiles:
- ingestion
ingestion-general:
extends:
file: docker-compose.base.yml
service: ingestion-general
image: ghcr.io/posthog/posthog-node:${POSTHOG_NODE_TAG:-master}
ports:
- '6739:6738'
environment:
DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_DB_NAME:-posthog}
PERSONS_DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_PERSONS_DB_NAME:-posthog}
CLICKHOUSE_DATABASE: ${CLICKHOUSE_DATABASE:-posthog}
depends_on:
kafka:
condition: service_started
redis7:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6738/_ready']
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
profiles:
- ingestion
ingestion-sessionreplay:
extends:
file: docker-compose.base.yml
service: ingestion-sessionreplay
image: ghcr.io/posthog/posthog-node:${POSTHOG_NODE_TAG:-master}
ports:
- '6740:6738'
environment:
DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_DB_NAME:-posthog}
ENCRYPTION_SALT_KEYS: '00beef0000beef0000beef0000beef00'
depends_on:
kafka:
condition: service_started
redis7:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6738/_ready']
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
profiles:
- ingestion
recording-api:
extends:
file: docker-compose.base.yml
service: recording-api
image: ghcr.io/posthog/posthog-node:${POSTHOG_NODE_TAG:-master}
ports:
- '6741:6738'
environment:
DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_DB_NAME:-posthog}
CLICKHOUSE_DATABASE: ${CLICKHOUSE_DATABASE:-posthog}
ENCRYPTION_SALT_KEYS: '00beef0000beef0000beef0000beef00'
depends_on:
redis7:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6738/_ready']
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
profiles:
- ingestion
ingestion-error-tracking:
extends:
file: docker-compose.base.yml
service: ingestion-error-tracking
image: ghcr.io/posthog/posthog-node:${POSTHOG_NODE_TAG:-master}
ports:
- '6742:6738'
environment:
DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_DB_NAME:-posthog}
PERSONS_DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_PERSONS_DB_NAME:-posthog}
depends_on:
kafka:
condition: service_started
redis7:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6738/_ready']
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
profiles:
- ingestion
ingestion-logs:
extends:
file: docker-compose.base.yml
service: ingestion-logs
image: ghcr.io/posthog/posthog-node:${POSTHOG_NODE_TAG:-master}
ports:
- '6743:6738'
environment:
DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_DB_NAME:-posthog}
depends_on:
kafka:
condition: service_started
redis7:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6738/_ready']
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
profiles:
- ingestion
ingestion-traces:
extends:
file: docker-compose.base.yml
service: ingestion-traces
image: ghcr.io/posthog/posthog-node:${POSTHOG_NODE_TAG:-master}
ports:
- '6744:6738'
environment:
DATABASE_URL: postgres://posthog:posthog@db:5432/${POSTHOG_DB_NAME:-posthog}
depends_on:
kafka:
condition: service_started
redis7:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6738/_ready']
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
profiles:
- ingestion
db:
extends:
file: docker-compose.base.yml
service: db
ports:
- '5432:5432'
volumes:
- postgres-15-data:/var/lib/postgresql/data
# something in the django app when running in dev mode
# (maybe only in Pycharm) keeps many idle transactions open
# and eventually kills postgres, these settings aim to stop that happening.
# They are only for DEV and should not be used in production.
command: postgres -c max_connections=1000 -c idle_in_transaction_session_timeout=300000 -c max_prepared_transactions=10
redis7:
extends:
file: docker-compose.base.yml
service: redis7
ports:
- '6379:6379'
redis-cluster:
image: redis:7.2
restart: on-failure
ports:
- '127.0.0.1:6399:6379'
command: >
bash -c "
redis-server
--port 6379
--cluster-enabled yes
--cluster-config-file /data/nodes.conf
--cluster-node-timeout 5000
--cluster-announce-ip 127.0.0.1
--cluster-announce-port 6399
--appendonly yes &
sleep 1 &&
redis-cli -p 6379 cluster addslots $$(seq 0 16383) &&
tail -f /dev/null
"
volumes:
- redis-cluster-data:/data
healthcheck:
test: ['CMD', 'redis-cli', '-p', '6379', 'cluster', 'info']
interval: 2s
timeout: 3s
retries: 10
flower:
extends:
file: docker-compose.base.yml
service: flower
ports:
- '5555:5555'
clickhouse:
extends:
file: docker-compose.base.yml
service: clickhouse
hostname: clickhouse
# Development performance optimizations
mem_limit: 8g
cpus: 2
environment:
- AWS_ACCESS_KEY_ID=object_storage_root_user
- AWS_SECRET_ACCESS_KEY=object_storage_root_password
- CLICKHOUSE_SKIP_USER_SETUP=1
ports:
- '8123:8123'
- '8443:8443'
- '9000:9000'
- '9440:9440'
- '9009:9009'
volumes:
- ./posthog/idl:/idl
- ./docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml
- ./docker/clickhouse/config.d/default.xml:/etc/clickhouse-server/config.d/default.xml
- ./docker/clickhouse/config.d/dev-memory.xml:/etc/clickhouse-server/config.d/dev-memory.xml
- ./docker/clickhouse/users-dev.xml:/etc/clickhouse-server/users.xml
- ./docker/clickhouse/user_defined_function.xml:/etc/clickhouse-server/user_defined_function.xml
- ./posthog/user_scripts:/var/lib/clickhouse/user_scripts
extra_hosts:
- 'host.docker.internal:host-gateway'
depends_on:
- kafka
- zookeeper
zookeeper:
extends:
file: docker-compose.base.yml
service: zookeeper
ports:
- '2181:2181'
kafka:
extends:
file: docker-compose.base.yml
service: kafka
ports:
- '9092:9092'
depends_on:
- zookeeper
kafka_ui:
extends:
file: docker-compose.base.yml
service: kafka_ui
ports:
- '9093:8080'
environment:
SERVER_MAX_HTTP_REQUEST_HEADER_SIZE: 65536
depends_on:
- kafka
objectstorage:
extends:
file: docker-compose.base.yml
service: objectstorage
ports:
- '19000:19000'
- '19001:19001'
objectstorage-azure:
extends:
file: docker-compose.base.yml
service: objectstorage-azure
ports:
- '10000:10000'
maildev:
extends:
file: docker-compose.base.yml
service: maildev
ports:
- '1080:1080'
- '1025:1025'
webhook-tester:
image: tarampampam/webhook-tester:2.2.6
restart: on-failure
ports:
- '2080:8080'
environment:
- AUTO_CREATE_SESSIONS=true
feature-flags:
extends:
file: docker-compose.base.yml
service: feature-flags
depends_on:
redis7:
condition: service_healthy
db:
condition: service_healthy
environment:
# Mode 2: Dual-write warming phase for developers
FLAGS_REDIS_URL: 'redis://redis7:6379/1'
FLAGS_REDIS_ENABLED: 'false' # Warming but not reading yet
REDIS_COMPRESSION_ENABLED: 'true'
# Temporal containers
elasticsearch:
extends:
file: docker-compose.base.yml
service: elasticsearch
expose:
- 9200
temporal:
extends:
file: docker-compose.base.yml
service: temporal
ports:
- 7233:7233
volumes:
- ./docker/temporal/dynamicconfig:/etc/temporal/config/dynamicconfig
temporal-admin-tools:
extends:
file: docker-compose.base.yml
service: temporal-admin-tools
depends_on:
- temporal
temporal-ui:
extends:
file: docker-compose.base.yml
service: temporal-ui
ports:
- 8081:8080
depends_on:
temporal:
condition: service_started
db:
condition: service_healthy
otel-collector:
extends:
file: docker-compose.base.yml
service: otel-collector
container_name: otel-collector-local
ports:
- '4317:4317' # OTLP gRPC receiver
- '4318:4318' # OTLP HTTP receiver
- '13133:13133' # health_check extension
- '55679:55679' # zpages extension
volumes:
- ./otel-collector-config.dev.yaml:/etc/otel-collector-config.yaml
environment:
# Used by otel-collector-config.dev.yaml to scope container log
# collection to this compose project only.
COMPOSE_PROJECT: posthog
depends_on:
- jaeger
- capture-logs
capture-logs:
extends:
file: docker-compose.base.yml
service: capture-logs
depends_on:
- kafka
jaeger:
extends:
file: docker-compose.base.yml
service: jaeger
container_name: jaeger-local
ports:
- '16686:16686' # Jaeger UI
- '14268:14268' # jaeger.thrift
- '14250:14250' # model.proto
localstack:
extends:
file: docker-compose.base.yml
service: localstack
container_name: '${LOCALSTACK_DOCKER_NAME:-localstack-main}'
ports:
- '127.0.0.1:4566:4566' # LocalStack Gateway
- '127.0.0.1:4510-4559:4510-4559' # external services port range
seaweedfs:
extends:
file: docker-compose.base.yml
service: seaweedfs
container_name: '${SEAWEEDFS_DOCKER_NAME:-seaweedfs-main}'
command: server -s3 -s3.port=8333 -filer -dir=/data
ports:
- '127.0.0.1:8333:8333' # S3 API
- '127.0.0.1:9333:9333' # Master server
- '127.0.0.1:8888:8888' # SeaweedFS Filer UI
volumes:
- 'seaweedfs-data:/data'
duckgres:
# DuckLake 0.4 + DuckDB 1.5.1, multi-arch (posthog/duckgres@5cfca88)
image: ghcr.io/posthog/duckgres:5cfca88a52f366765fcdb122056e7ad3f038ec4f
restart: on-failure
profiles: ['duckgres']
ports:
- '15432:15432'
volumes:
- ./devenv/duckgres.yaml:/app/config.yaml:ro
- duckgres-data:/app/data
depends_on:
db:
condition: service_healthy
objectstorage:
condition: service_started
command: ['--config', '/app/config.yaml']
etcd:
image: quay.io/coreos/etcd:v3.6.8
restart: on-failure
environment:
ETCD_NAME: etcd0
ETCD_ADVERTISE_CLIENT_URLS: http://etcd:2379
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ports:
- '127.0.0.1:2379:2379'
healthcheck:
test: ['CMD', 'etcdctl', 'endpoint', 'health']
interval: 5s
timeout: 5s
retries: 10
networks:
otel_network:
driver: bridge
volumes:
postgres-15-data:
redis-cluster-data:
redpanda-data:
seaweedfs-data:
duckgres-data: