-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
156 lines (151 loc) · 5.01 KB
/
docker-compose.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
#
# `docker-compose` file used ONLY for hobby deployments.
#
# Please take a look at https://posthog.com/docs/self-host/deploy/hobby
# for more info.
#
version: '3'
services:
db:
hostname: posthog_db
image: postgres:12-alpine
restart: on-failure
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- ${POSTGRES_PORT}:6432 # we'll use the custom port for db
command: -p 6432
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
#
hostname: posthog_clickhouse
build:
context: .
dockerfile: build/Dockerfile.Clickhouse
restart: on-failure
depends_on:
- kafka
- zookeeper
volumes:
- ./posthog/posthog/idl:/idl
- ./posthog/docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./posthog/docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml
- ./posthog/docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml
- clickhouse-data:/var/lib/clickhouse
zookeeper:
image: zookeeper:3.7.0
restart: on-failure
volumes:
- zookeeper-datalog:/datalog
- zookeeper-data:/data
- zookeeper-logs:/logs
kafka:
image: bitnami/kafka:2.8.1-debian-10-r99
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'
worker: &worker
build:
context: .
dockerfile: build/Dockerfile.Posthog
command: ./bin/docker-worker-celery --with-scheduler
restart: on-failure
environment:
SENTRY_DSN: ${SENTRY_DSN}
SITE_URL: ${SITE_URL}
DISABLE_SECURE_SSL_REDIRECT: ${DISABLE_SECURE_SSL_REDIRECT}
IS_BEHIND_PROXY: ${IS_BEHIND_PROXY}
TRUST_ALL_PROXIES: ${TRUST_ALL_PROXIES}
DATABASE_URL: ${DATABASE_URL}
CLICKHOUSE_HOST: posthog_clickhouse
CLICKHOUSE_DATABASE: 'posthog'
CLICKHOUSE_SECURE: ${CLICKHOUSE_SECURE}
CLICKHOUSE_VERIFY: ${CLICKHOUSE_VERIFY}
KAFKA_URL: kafka://kafka
REDIS_URL: ${REDIS_URL}
SECRET_KEY: ${SECRET_KEY}
PGHOST: ${POSTGRES_HOST}
PGUSER: ${POSTGRES_USER}
PGPASSWORD: ${POSTGRES_PASSWORD}
PGPORT: ${POSTGRES_PORT}
DEPLOYMENT: ${DEPLOYMENT}
depends_on:
- db
- redis
- clickhouse
- kafka
- object_storage
web:
<<: *worker
command: /compose/start
restart: on-failure
ports:
- "${PORT}:8000"
volumes:
- ./compose:/compose
# nginx:
# image: nginx:1.15-alpine
# ports:
# - "9080:80"
# - "9443:443"
# volumes:
# - ./nginx/nginx/sites-available/testposthog.conf:/etc/nginx/conf.d/testposthog.conf
# - ./nginx/live/test990.whizzygeeks.com/:/etc/test990.whizzygeeks.com
# depends_on:
# - web
plugins:
build:
context: .
dockerfile: build/Dockerfile.Posthog
command: ./bin/plugin-server --no-restart-loop
restart: on-failure
environment:
DATABASE_URL: ${DATABASE_URL}
KAFKA_HOSTS: kafka:9092
REDIS_URL: ${REDIS_URL}
CLICKHOUSE_HOST: posthog_clickhouse
depends_on:
- db
- redis
- clickhouse
- kafka
- object_storage
object_storage:
image: minio/minio:RELEASE.2022-09-17T00-09-45Z.fips
restart: on-failure
volumes:
- object_storage:/data
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_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
asyncmigrationscheck:
<<: *worker
command: python manage.py run_async_migrations --check
restart: 'no'
scale: 0
volumes:
zookeeper-data:
zookeeper-datalog:
zookeeper-logs:
object_storage:
postgres-data:
clickhouse-data: