-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
360 lines (336 loc) · 11.1 KB
/
docker-compose.yml
File metadata and controls
360 lines (336 loc) · 11.1 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
x-healthcheck-common: &healthcheck-common
interval: 10s
timeout: 10s
retries: 3
start_period: 15s
x-env-bulker-connect: &env-bulker-connect
BULKER_URL: http://prefixsrv_bulker:3042
BULKER_AUTH_KEY: ${BULKER_TOKEN}
x-env-clickhouse-connect: &env-clickhouse-connect
CLICKHOUSE_HOST: prefixsrv_clickhouse:8123
#CLICKHOUSE_USERNAME: default
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWD}
CLICKHOUSE_DATABASE: ${CLICKHOUSE_DB}
x-env-mongo-connect: &env-mongo-connect
MONGODB_URL: "mongodb://${MONGO_USER}:${MONGO_PASSWD}@prefixsrv_mongo/"
MONGODB_NETWORK_COMPRESSION: none
x-depend-console: &depend-console
prefixsrv_console:
condition: service_healthy
x-depend-bulker: &depend-bulker
prefixsrv_bulker:
condition: service_healthy
x-depend-redis: &depend-redis
prefixsrv_redis:
condition: service_healthy
x-depend-mongo: &depend-mongo
prefixsrv_mongo:
condition: service_healthy
x-depend-kafka: &depend-kafka
prefixsrv_kafka:
condition: service_healthy
x-depend-clickhouse: &depend-clickhouse
prefixsrv_clickhouse:
condition: service_healthy
x-depend-postgres: &depend-postgres
prefixsrv_postgres:
condition: service_healthy
x-depend-rotor: &depend-rotor
prefixsrv_rotor:
condition: service_healthy
x-logging-json: &logging-json
logging:
driver: json-file
options:
mode: "non-blocking"
max-size: "50m"
max-file: "3"
x-logging-journald: &logging-journald
logging:
driver: journald
x-logging-loki: &logging-loki
logging:
driver: loki
options:
mode: "non-blocking"
loki-url: http://127.0.0.1:3100/loki/api/v1/push
max-size: "50m"
max-file: "3"
services:
# https://hub.docker.com/r/bitnami/kafka
prefixsrv_kafka:
<<:
- *logging-json
image: bitnami/kafka:3.9
container_name: prefixsrv_kafka
hostname: prefixsrv_kafka
restart: always
environment:
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@prefixsrv_kafka:9093
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
healthcheck:
<<:
- *healthcheck-common
test:
- "CMD-SHELL"
- "kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --list"
volumes:
# chown -R 1001:1001 ./data/kafka
- ./data/kafka:/bitnami/kafka
# https://hub.docker.com/_/redis
prefixsrv_redis:
<<:
- *logging-json
image: redis:7-alpine
container_name: prefixsrv_redis
hostname: prefixsrv_redis
restart: always
user: 10000:10000
command:
- redis-server
- --save 20 1
- --requirepass ${REDIS_PASSWD}
healthcheck:
<<:
- *healthcheck-common
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWD}", "ping"]
volumes:
# chown -R 10000:10000 ./data/redis
- ./data/redis:/data
# https://hub.docker.com/_/clickhouse
prefixsrv_clickhouse:
<<:
- *logging-json
image: clickhouse/clickhouse-server:latest
container_name: prefixsrv_clickhouse
hostname: prefixsrv_clickhouse
restart: always
environment:
CLICKHOUSE_DB: ${CLICKHOUSE_DB}
CLICKHOUSE_USER: default
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWD}
healthcheck:
<<:
- *healthcheck-common
test:
- "CMD-SHELL"
- 'wget --quiet --spider --user default --password ${CLICKHOUSE_PASSWD} "http://127.0.0.1:8123/ping" || exit 1'
volumes:
- ./data/clickhouse:/var/lib/clickhouse
- ./log/clickhouse:/var/log/clickhouse-server
# https://hub.docker.com/_/mongo
prefixsrv_mongo:
<<:
- *logging-json
image: mongo:latest
container_name: prefixsrv_mongo
hostname: prefixsrv_mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWD}
healthcheck:
<<:
- *healthcheck-common
test:
- "CMD-SHELL"
- 'mongosh -u ${MONGO_USER} -p ${MONGO_PASSWD} --authenticationDatabase admin --eval "db.runCommand({ ping: 1 })" || exit 1'
volumes:
- ./data/mongo:/data/db
# https://hub.docker.com/_/postgres
prefixsrv_postgres:
<<:
- *logging-json
image: postgres:17-alpine
container_name: prefixsrv_postgres
hostname: prefixsrv_postgres
restart: always
environment:
POSTGRES_USER: ${PG_USER}
POSTGRES_DB: ${PG_USER}
POSTGRES_PASSWORD: ${PG_PASSWD}
healthcheck:
<<:
- *healthcheck-common
test:
- "CMD-SHELL"
- 'su postgres -c "pg_isready -U ${PG_USER}"'
volumes:
- ./data/postgres:/var/lib/postgresql/data
prefixsrv_console:
<<:
- *logging-json
image: jitsucom/console:latest
container_name: prefixsrv_console
hostname: prefixsrv_console
restart: always
environment:
<<:
- *env-bulker-connect
- *env-clickhouse-connect
- *env-mongo-connect
ROTOR_URL: http://prefixsrv_rotor:3401
ROTOR_AUTH_KEY: ${BULKER_TOKEN}
CONSOLE_RAW_AUTH_TOKENS: ${CONSOLE_TOKEN}
MIT_COMPLIANT: false
DATABASE_URL: "postgresql://${PG_USER}:${PG_PASSWD}@prefixsrv_postgres:5432/postgres?schema=newjitsu"
SEED_USER_EMAIL: ${SEED_USER_EMAIL}
SEED_USER_PASSWORD: ${SEED_USER_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
ENABLE_CREDENTIALS_LOGIN: true
#GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
#GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
SYNCS_ENABLED: false
#SYNCCTL_URL: "http://syncctl:${EXTERNAL_SYNCS_PORT:-3043}"
#SYNCCTL_AUTH_KEY: ${SYNCCTL_TOKEN:-default}
#GOOGLE_SCHEDULER_KEY: ${GOOGLE_SCHEDULER_KEY}
JITSU_INGEST_PUBLIC_URL: ${JITSU_INGEST_PUBLIC_URL}
JITSU_PUBLIC_URL: ${JITSU_PUBLIC_URL}
NEXTAUTH_URL: ${JITSU_PUBLIC_URL}
FORCE_UPDATE_DB: true
DISABLE_SIGNUP: true
JITSU_DISABLE_ANONYMOUS_TELEMETRY: true
healthcheck:
<<:
- *healthcheck-common
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000/api/healthcheck"]
depends_on:
<<:
- *depend-clickhouse
- *depend-mongo
- *depend-postgres
ports:
- 3000:3000
prefixsrv_sync_catalog_init:
<<:
- *logging-json
image: curlimages/curl
container_name: prefixsrv_sync_catalog_init
hostname: prefixsrv_sync_catalog_init
restart: on-failure
environment:
CONSOLE_TOKEN: ${CONSOLE_TOKEN}
command:
- "curl"
- "--silent"
- "--show-error"
- '-H "Authorization: Bearer service-admin-account:${CONSOLE_TOKEN}"'
- "http://prefixsrv_console:3000/api/admin/catalog-refresh?initial=true"
depends_on:
<<:
- *depend-console
prefixsrv_bulker:
<<:
- *logging-json
image: jitsucom/bulker:latest
container_name: prefixsrv_bulker
hostname: prefixsrv_bulker
restart: always
environment:
BULKER_KAFKA_BOOTSTRAP_SERVERS: "prefixsrv_kafka:9092"
BULKER_RAW_AUTH_TOKENS: ${BULKER_TOKEN}
BULKER_CONFIG_SOURCE: "http://prefixsrv_console:3000/api/admin/export/bulker-connections"
BULKER_CONFIG_SOURCE_HTTP_AUTH_TOKEN: "service-admin-account:${CONSOLE_TOKEN}"
BULKER_CACHE_DIR: "/tmp/cache"
BULKER_INTERNAL_TASK_LOG: '{"id":"task_log","metricsKeyPrefix":"syncs","usesBulker":true,"type":"postgres","options":{"mode":"stream"},"credentials":{"host":"prefixsrv_postgres","port":5432,"sslMode":"disable","database":"${PG_USER}","password":"${PG_PASSWD}","username":"${PG_USER}","defaultSchema":"newjitsu"}}'
BULKER_CLICKHOUSE_HOST: "prefixsrv_clickhouse:9000"
BULKER_CLICKHOUSE_PASSWORD: "${CLICKHOUSE_PASSWD}"
BULKER_CLICKHOUSE_DATABASE: "${CLICKHOUSE_DB}"
healthcheck:
<<:
- *healthcheck-common
test: ["CMD", "curl", "-f", "http://127.0.0.1:3042/health"]
depends_on:
<<:
- *depend-clickhouse
- *depend-console
- *depend-kafka
- *depend-postgres
prefixsrv_rotor:
<<:
- *logging-json
image: jitsucom/rotor:latest
container_name: prefixsrv_rotor
hostname: prefixsrv_rotor
restart: always
environment:
<<:
- *env-bulker-connect
- *env-clickhouse-connect
- *env-mongo-connect
ROTOR_RAW_AUTH_TOKENS: ${BULKER_TOKEN}
KAFKA_BOOTSTRAP_SERVERS: "prefixsrv_kafka:9092"
REDIS_URL: "redis://default:${REDIS_PASSWD}@prefixsrv_redis:6379"
REPOSITORY_BASE_URL: "http://prefixsrv_console:3000/api/admin/export/"
REPOSITORY_AUTH_TOKEN: "service-admin-account:${CONSOLE_TOKEN}"
REPOSITORY_CACHE_DIR: "/tmp/cache"
# MAXMIND_LICENSE_KEY:
# MAXMIND_URL:
healthcheck:
<<:
- *healthcheck-common
test: ["CMD", "curl", "-f", "http://127.0.0.1:3401/health"]
depends_on:
<<:
- *depend-bulker
- *depend-clickhouse
- *depend-console
- *depend-kafka
- *depend-mongo
- *depend-redis
prefixsrv_ingest:
<<:
- *logging-json
image: jitsucom/ingest:latest
container_name: prefixsrv_ingest
hostname: prefixsrv_ingest
restart: always
environment:
INGEST_PUBLIC_URL: "${JITSU_INGEST_PUBLIC_URL}"
INGEST_KAFKA_BOOTSTRAP_SERVERS: "prefixsrv_kafka:9092"
INGEST_RAW_AUTH_TOKENS: ${BULKER_TOKEN}
INGEST_REPOSITORY_URL: "http://prefixsrv_console:3000/api/admin/export/streams-with-destinations"
INGEST_SCRIPT_ORIGIN: "http://prefixsrv_console:3000/api/s/javascript-library"
INGEST_REPOSITORY_AUTH_TOKEN: "service-admin-account:${CONSOLE_TOKEN}"
INGEST_CACHE_DIR: "/tmp/cache"
INGEST_ROTOR_URL: "http://prefixsrv_rotor:3401"
INGEST_ROTOR_AUTH_KEY: ${BULKER_TOKEN}
INGEST_CLICKHOUSE_HOST: prefixsrv_clickhouse:9000
INGEST_CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWD}
INGEST_CLICKHOUSE_DATABASE: ${CLICKHOUSE_DB}
healthcheck:
<<:
- *healthcheck-common
test: ["CMD", "curl", "-f", "http://127.0.0.1:3049/health"]
depends_on:
<<:
- *depend-clickhouse
- *depend-console
- *depend-kafka
- *depend-rotor
ports:
- 8080:3049
# For kubernetes
# syncctl:
# tty: true
# image: jitsucom/syncctl:${DOCKER_TAG:-latest}
# platform: linux/amd64
# restart: "on-failure"
# environment:
# TERM: "xterm-256color"
# HTTP_PORT: ${EXTERNAL_SYNCS_PORT:-3043}
# SYNCCTL_SYNCS_ENABLED: ${SYNCS_ENABLED:-false}
# SYNCCTL_RAW_AUTH_TOKENS: ${SYNCCTL_TOKEN:-default}
# SYNCCTL_DATABASE_URL: "postgresql://postgres:${POSTGRES_PASSWORD:-default}@127.0.0.1:${EXTERNAL_POSTGRES_PORT:-5432}/postgres?search_path=newjitsu"
# SYNCCTL_SIDECAR_DATABASE_URL: "postgresql://postgres:${POSTGRES_PASSWORD:-default}@${EXTERNAL_POSTGRES_HOST}:${EXTERNAL_POSTGRES_PORT:-5432}/postgres?search_path=newjitsu"
# SYNCCTL_KUBERNETES_CLIENT_CONFIG: "${SYNCCTL_KUBERNETES_CLIENT_CONFIG:-local}"
# SYNCCTL_KUBERNETES_CONTEXT: "${SYNCCTL_KUBERNETES_CONTEXT}"
# network_mode: "host"
# depends_on:
# bulker:
# condition: service_healthy