forked from graphql-hive/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.community.yml
327 lines (311 loc) · 8.57 KB
/
docker-compose.community.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
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
version: '3.8'
networks:
stack: {}
services:
db:
image: postgres:13.4-alpine
environment:
POSTGRES_DB: '${POSTGRES_DB}'
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
PGDATA: /var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}']
interval: 5s
timeout: 5s
retries: 6
networks:
- 'stack'
volumes:
- ./.hive/postgres:/var/lib/postgresql/data
clickhouse:
image: clickhouse/clickhouse-server:22.11-alpine
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'localhost:8123/ping']
interval: 5s
timeout: 5s
retries: 6
start_period: 10s
environment:
CLICKHOUSE_USER: '${CLICKHOUSE_USER}'
CLICKHOUSE_PASSWORD: '${CLICKHOUSE_PASSWORD}'
networks:
- 'stack'
volumes:
- ./.hive/clickhouse/db:/var/lib/clickhouse
zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
hostname: zookeeper
networks:
- 'stack'
ulimits:
nofile:
soft: 20000
hard: 40000
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
volumes:
- ./.hive/zookeeper/db:/var/lib/zookeeper/data
broker:
image: confluentinc/cp-kafka:7.3.0
hostname: broker
depends_on:
zookeeper:
condition: service_started
networks:
- 'stack'
ulimits:
nofile:
soft: 20000
hard: 40000
healthcheck:
test:
[
'CMD',
'cub',
'kafka-ready',
'1',
'5',
'-b',
'127.0.0.1:9092',
'-c',
'/etc/kafka/kafka.properties',
]
interval: 15s
timeout: 10s
retries: 6
start_period: 15s
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
volumes:
- ./.hive/broker/db:/var/lib/kafka/data
redis:
image: bitnami/redis:6.2
networks:
- 'stack'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 10s
retries: 6
start_period: 5s
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
volumes:
- './.hive/redis/db:/bitnami/redis/data'
supertokens:
image: registry.supertokens.io/supertokens/supertokens-postgresql:4.2
depends_on:
db:
condition: service_healthy
networks:
- 'stack'
environment:
POSTGRESQL_USER: '${POSTGRES_USER}'
POSTGRESQL_PASSWORD: '${POSTGRES_PASSWORD}'
POSTGRESQL_DATABASE_NAME: '${POSTGRES_DB}'
POSTGRESQL_TABLE_NAMES_PREFIX: 'supertokens'
POSTGRESQL_HOST: db
POSTGRESQL_PORT: 5432
API_KEYS: '${SUPERTOKENS_API_KEY}'
ACCESS_TOKEN_BLACKLISTING: 'true'
storage:
image: '${DOCKER_REGISTRY}storage${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
clickhouse:
condition: service_healthy
db:
condition: service_healthy
environment:
MIGRATOR: 'up'
CLICKHOUSE_MIGRATOR: 'up'
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: '${POSTGRES_DB}'
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
CLICKHOUSE_PROTOCOL: 'http'
CLICKHOUSE_HOST: 'clickhouse'
CLICKHOUSE_PORT: '8123'
CLICKHOUSE_USERNAME: '${CLICKHOUSE_USER}'
CLICKHOUSE_PASSWORD: '${CLICKHOUSE_PASSWORD}'
# Tell dockest, we want to wait for the exit code of the migrator to be 0
labels:
dockest.readiness: 'exit_code'
server:
image: '${DOCKER_REGISTRY}server${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
redis:
condition: service_healthy
clickhouse:
condition: service_healthy
storage:
condition: service_completed_successfully
tokens:
condition: service_healthy
webhooks:
condition: service_healthy
emails:
condition: service_healthy
schema:
condition: service_healthy
ports:
- '8082:3001'
environment:
NODE_ENV: production
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: '${POSTGRES_DB}'
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
ROARR_LOG: 'true'
CLICKHOUSE_PROTOCOL: 'http'
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_USERNAME: '${CLICKHOUSE_USER}'
CLICKHOUSE_PASSWORD: '${CLICKHOUSE_PASSWORD}'
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: '${REDIS_PASSWORD}'
TOKENS_ENDPOINT: http://tokens:3003
WEBHOOKS_ENDPOINT: http://webhooks:3005
SCHEMA_ENDPOINT: http://schema:3002
EMAILS_ENDPOINT: http://emails:3011
ENCRYPTION_SECRET: '${HIVE_ENCRYPTION_SECRET}'
WEB_APP_URL: '${HIVE_APP_BASE_URL}'
PORT: 3001
SUPERTOKENS_CONNECTION_URI: http://supertokens:3567
SUPERTOKENS_API_KEY: '${SUPERTOKENS_API_KEY}'
schema:
image: '${DOCKER_REGISTRY}schema${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
redis:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 3002
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: '${REDIS_PASSWORD}'
ENCRYPTION_SECRET: '${HIVE_ENCRYPTION_SECRET}'
tokens:
image: '${DOCKER_REGISTRY}tokens${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
storage:
condition: service_completed_successfully
environment:
NODE_ENV: production
POSTGRES_HOST: db
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
POSTGRES_PORT: 5432
POSTGRES_DB: '${POSTGRES_DB}'
ROARR_LOG: 'true'
PORT: 3003
webhooks:
image: '${DOCKER_REGISTRY}webhooks${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
redis:
condition: service_healthy
environment:
NODE_ENV: production
BULLMQ_COMMANDS_FROM_ROOT: 'true'
PORT: 3005
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: '${REDIS_PASSWORD}'
emails:
image: '${DOCKER_REGISTRY}emails${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
redis:
condition: service_healthy
environment:
NODE_ENV: production
BULLMQ_COMMANDS_FROM_ROOT: 'true'
PORT: 3011
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: '${REDIS_PASSWORD}'
EMAIL_FROM: [email protected]
EMAIL_PROVIDER: sendmail
usage:
image: '${DOCKER_REGISTRY}usage${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
broker:
condition: service_healthy
tokens:
condition: service_healthy
ports:
- 8081:3006
environment:
NODE_ENV: production
TOKENS_ENDPOINT: http://tokens:3003
KAFKA_CONNECTION_MODE: 'docker'
KAFKA_TOPIC: 'usage_reports_v2'
KAFKA_BROKER: broker:29092
KAFKA_BUFFER_SIZE: 350
KAFKA_BUFFER_INTERVAL: 1000
KAFKA_BUFFER_DYNAMIC: '1'
PORT: 3006
usage-ingestor:
image: '${DOCKER_REGISTRY}usage-ingestor${DOCKER_TAG}'
networks:
- 'stack'
depends_on:
broker:
condition: service_healthy
clickhouse:
condition: service_healthy
environment:
NODE_ENV: production
KAFKA_CONNECTION_MODE: 'docker'
KAFKA_BROKER: broker:29092
KAFKA_CONCURRENCY: '1'
KAFKA_CONSUMER_GROUP: 'usage-ingestor-v2'
KAFKA_TOPIC: 'usage_reports_v2'
CLICKHOUSE_PROTOCOL: 'http'
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_USERNAME: '${CLICKHOUSE_USER}'
CLICKHOUSE_PASSWORD: '${CLICKHOUSE_PASSWORD}'
PORT: 3007
app:
image: '${DOCKER_REGISTRY}app${DOCKER_TAG}'
ports:
- '8080:3000'
networks:
- 'stack'
environment:
PORT: 3000
NODE_ENV: production
APP_BASE_URL: '${HIVE_APP_BASE_URL}'
SUPERTOKENS_CONNECTION_URI: http://supertokens:3567
SUPERTOKENS_API_KEY: '${SUPERTOKENS_API_KEY}'
EMAILS_ENDPOINT: http://emails:3011
GRAPHQL_ENDPOINT: http://server:3001/graphql
SERVER_ENDPOINT: http://server:3001
AUTH_REQUIRE_EMAIL_VERIFICATION: '0'