forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
304 lines (268 loc) · 8.29 KB
/
docker-compose.dev.yml
File metadata and controls
304 lines (268 loc) · 8.29 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
#
# 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
}
}
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
redis:
extends:
file: docker-compose.base.yml
service: redis
ports:
- '6379:6379'
redis7:
extends:
file: docker-compose.base.yml
service: redis7
ports:
- '6479:6379'
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
- ./posthog/user_scripts/latest_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
maildev:
extends:
file: docker-compose.base.yml
service: maildev
ports:
- '1080:1080'
- '1025:1025'
webhook-tester:
image: tarampampam/webhook-tester:1.1.0
restart: on-failure
ports:
- '2080:2080'
environment:
- LISTEN_PORT=2080
echo_server:
extends:
file: docker-compose.base.yml
service: echo_server
feature-flags:
extends:
file: docker-compose.base.yml
service: feature-flags
depends_on:
- redis
- db
environment:
# Mode 2: Dual-write warming phase for developers
FLAGS_REDIS_URL: 'redis://redis: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
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
depends_on:
temporal:
condition: service_started
db:
condition: service_healthy
otel-collector:
extends:
file: docker-compose.base.yml
service: otel-collector
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
localstack:
extends:
file: docker-compose.base.yml
service: localstack
seaweedfs:
extends:
file: docker-compose.base.yml
service: seaweedfs
command: server -s3 -s3.port=8333 -filer -dir=/data
ports:
- '127.0.0.1:8888:8888' # SeaweedFS Filer UI
volumes:
- 'seaweedfs-data:/data'
networks:
otel_network:
driver: bridge
volumes:
postgres-15-data:
redpanda-data:
seaweedfs-data: