forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.base.yml
215 lines (200 loc) · 6.42 KB
/
docker-compose.base.yml
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
#
# docker-compose base file used for local development, hobby deploys, and other compose use cases.
#
services:
db:
image: postgres:12-alpine
restart: on-failure
environment:
POSTGRES_USER: posthog
POSTGRES_DB: posthog
POSTGRES_PASSWORD: posthog
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U posthog']
interval: 5s
timeout: 5s
redis:
image: redis:6.2.7-alpine
restart: on-failure
command: redis-server --maxmemory-policy allkeys-lru --maxmemory 200mb
clickhouse:
#
# Note: please keep the default version in sync across
# `posthog` and the `charts-clickhouse` repos
#
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.11.2.11-alpine}
restart: on-failure
depends_on:
- kafka
- zookeeper
zookeeper:
image: zookeeper:3.7.0
restart: on-failure
kafka:
image: ghcr.io/posthog/kafka-container:v2.8.2
restart: on-failure
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1001
KAFKA_CFG_RESERVED_BROKER_MAX_ID: 1001
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: 'true'
object_storage:
image: minio/minio:RELEASE.2022-06-25T15-50-16Z
restart: on-failure
environment:
MINIO_ROOT_USER: object_storage_root_user
MINIO_ROOT_PASSWORD: object_storage_root_password
entrypoint: sh
command: -c 'mkdir -p /data/posthog && minio server --address ":19000" --console-address ":19001" /data' # create the 'posthog' bucket before starting the service
maildev:
image: maildev/maildev:2.0.5
restart: on-failure
flower:
image: mher/flower:2.0.0
restart: on-failure
environment:
FLOWER_PORT: 5555
CELERY_BROKER_URL: redis://redis:6379
worker: &worker
command: ./bin/docker-worker-celery --with-scheduler
restart: on-failure
environment:
DISABLE_SECURE_SSL_REDIRECT: 'true'
IS_BEHIND_PROXY: 'true'
DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog'
CLICKHOUSE_HOST: 'clickhouse'
CLICKHOUSE_DATABASE: 'posthog'
CLICKHOUSE_SECURE: 'false'
CLICKHOUSE_VERIFY: 'false'
KAFKA_HOSTS: 'kafka'
REDIS_URL: 'redis://redis:6379/'
PGHOST: db
PGUSER: posthog
PGPASSWORD: posthog
DEPLOYMENT: hobby
depends_on:
- db
- redis
- clickhouse
- kafka
- object_storage
web:
<<: *worker
command: ./bin/start-backend & ./bin/start-frontend
restart: on-failure
capture:
image: ghcr.io/posthog/capture:main
restart: on-failure
environment:
ADDRESS: '0.0.0.0:3000'
KAFKA_TOPIC: 'events_plugin_ingestion'
KAFKA_HOSTS: 'kafka:9092'
REDIS_URL: 'redis://redis:6379/'
depends_on:
- redis
- kafka
plugins:
command: ./bin/plugin-server --no-restart-loop
restart: on-failure
environment:
DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog'
KAFKA_HOSTS: 'kafka:9092'
REDIS_URL: 'redis://redis:6379/'
CLICKHOUSE_HOST: 'clickhouse'
CLICKHOUSE_DATABASE: 'posthog'
CLICKHOUSE_SECURE: 'false'
CLICKHOUSE_VERIFY: 'false'
depends_on:
- db
- redis
- clickhouse
- kafka
- object_storage
migrate:
<<: *worker
command: sh -c "
python manage.py migrate
&& python manage.py migrate_clickhouse
&& python manage.py run_async_migrations
"
restart: 'no'
deploy:
replicas: 0
asyncmigrationscheck:
<<: *worker
command: python manage.py run_async_migrations --check
restart: 'no'
deploy:
replicas: 0
environment:
SKIP_ASYNC_MIGRATIONS_SETUP: 0
# Temporal containers
elasticsearch:
environment:
- cluster.routing.allocation.disk.threshold_enabled=true
- cluster.routing.allocation.disk.watermark.low=512mb
- cluster.routing.allocation.disk.watermark.high=256mb
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m
- xpack.security.enabled=false
image: elasticsearch:7.16.2
expose:
- 9200
volumes:
- /var/lib/elasticsearch/data
temporal:
depends_on:
db:
condition: service_healthy
environment:
- DB=postgresql
- DB_PORT=5432
- POSTGRES_USER=posthog
- POSTGRES_PWD=posthog
- POSTGRES_SEEDS=db
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml
- ENABLE_ES=true
- ES_SEEDS=elasticsearch
- ES_VERSION=v7
image: temporalio/auto-setup:1.20.0
ports:
- 7233:7233
labels:
kompose.volume.type: configMap
volumes:
- ./docker/temporal/dynamicconfig:/etc/temporal/config/dynamicconfig
temporal-admin-tools:
depends_on:
- temporal
environment:
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: temporalio/admin-tools:1.20.0
stdin_open: true
tty: true
temporal-ui:
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:2.10.3
ports:
- 8081:8080
temporal-django-worker:
<<: *worker
command: ./bin/temporal-django-worker
restart: on-failure
environment:
TEMPORAL_HOST: temporal
depends_on:
- db
- redis
- clickhouse
- kafka
- object_storage
- temporal