forked from dotCMS/core
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
300 lines (284 loc) · 9.76 KB
/
docker-compose.yml
File metadata and controls
300 lines (284 loc) · 9.76 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
services:
# Analytics Database (separate from dotCMS DB)
analytics-postgres:
container_name: analytics-postgres
image: pgvector/pgvector:pg18
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRESQL_DB:-postgres}
POSTGRES_USER: ${POSTGRESQL_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRESQL_PASS:-postgres}
ports:
- ${POSTGRESQL_HOST_PORT:-54321}:5432
networks:
- analytics-net
volumes:
- analytics-db-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRESQL_USER:-postgres} -d ${POSTGRESQL_DB:-postgres} -h localhost -p 5432"]
interval: 10s
timeout: 5s
retries: 5
# dotCMS Database
dotcms-db:
profiles: ["full"]
container_name: dotcms-db
image: pgvector/pgvector:pg18
command: postgres -c 'max_connections=400' -c 'shared_buffers=128MB'
environment:
POSTGRES_USER: 'dotcmsdbuser'
POSTGRES_PASSWORD: 'password'
POSTGRES_DB: 'dotcms'
volumes:
- dotcms-db-data:/var/lib/postgresql
networks:
- dotcms-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dotcmsdbuser -d dotcms -h localhost -p 5432"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# OpenSearch for dotCMS
opensearch:
profiles: ["full"]
container_name: opensearch
image: opensearchproject/opensearch:1
environment:
cluster.name: "elastic-cluster"
discovery.type: "single-node"
bootstrap.memory_lock: "true"
OPENSEARCH_JAVA_OPTS: "-Xmx1G"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "9200:9200"
- "9600:9600"
volumes:
- opensearch-data:/usr/share/opensearch/data
networks:
- dotcms-net
deploy:
resources:
limits:
cpus: "1.0"
memory: 2G
keycloak:
container_name: keycloak
depends_on:
- analytics-postgres
environment:
DB_VENDOR: postgres
DB_ADDR: analytics-postgres
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-keycloak}
DB_DATABASE: ${POSTGRESQL_DB:-postgres}
DB_USER: ${POSTGRESQL_USER:-postgres}
DB_PASSWORD: ${POSTGRESQL_PASS:-postgres}
KC_HOSTNAME_STRICT_HTTPS: false
KC_HOSTNAME_STRICT: false
KC_HTTP_ENABLED: true
image: quay.io/keycloak/keycloak:${KEYCLOAK_VERSION:-18.0.2}
volumes:
- ./setup/config/dev/keycloak/test-realm.json:/opt/keycloak/data/import/example-realm.json
entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev", "--import-realm", "--hostname-strict-https=false", "--http-enabled=true"]
ports:
- "${KEYCLOAK_HOST_PORT:-61111}:8080"
networks:
- analytics-net
restart: always
# dotCMS with Analytics Pre-configured
dotcms:
profiles: ["full"]
container_name: dotcms
image: dotcms/dotcms-test:1.0.0-SNAPSHOT
environment:
# dotCMS Core Configuration
CMS_JAVA_OPTS: '-Xmx1g'
LANG: 'C.UTF-8'
TZ: 'UTC'
DB_BASE_URL: "jdbc:postgresql://dotcms-db/dotcms"
DB_USERNAME: 'dotcmsdbuser'
DB_PASSWORD: 'password'
DOT_ES_AUTH_BASIC_PASSWORD: 'admin'
DOT_ES_ENDPOINTS: 'https://opensearch:9200'
DOT_INITIAL_ADMIN_PASSWORD: 'admin'
DOT_DOTCMS_CLUSTER_ID: 'dotcms-analytics-cluster'
GLOWROOT_ENABLED: 'true'
GLOWROOT_WEB_UI_ENABLED: 'true'
DOT_ALLOW_ACCESS_TO_PRIVATE_SUBNETS: 'true'
# Analytics Configuration (Environment Variables Override)
# Internal URLs (container-to-container communication)
DOT_FEATURE_FLAG_EXPERIMENTS: "true"
DOT_ENABLE_EXPERIMENTS_AUTO_JS_INJECTION: "true"
DOT_FEATURE_FLAG_CONTENT_ANALYTICS_AUTO_INJECT: "true"
DOT_FEATURE_FLAG_CONTENT_ANALYTICS: "true"
DOT_ANALYTICS_IDP_URL: "http://keycloak:8080/realms/dotcms/protocol/openid-connect/token"
DOT_ANALYTICS_APP_CONFIG_URL: "http://dotcms-analytics:8080/c/customer1/cluster1/keys"
DOT_ANALYTICS_APP_WRITE_URL: "http://jitsu:8001/api/v1/event"
DOT_ANALYTICS_APP_READ_URL: "http://cube:4000"
# Analytics Client Configuration (customer1:cluster1)
DOT_ANALYTICS_APP_CLIENT_ID: "analytics-customer-customer1"
DOT_ANALYTICS_APP_CLIENT_SECRET: "testsecret"
depends_on:
dotcms-db:
condition: service_healthy
opensearch:
condition: service_started
keycloak:
condition: service_started
volumes:
- cms-shared:/data/shared
networks:
- dotcms-net
- analytics-net # Bridge to analytics network
ports:
- "8082:8082" # HTTP
- "8443:8443" # HTTPS
- "4000:4000" # Glowroot web UI
dotcms-analytics:
container_name: dotcms-analytics
image: ghcr.io/dotcms/internal-infrastructure/configurator:latest
environment:
#- JITSU_USE_CONFIGURATOR='true'
#- JITSU_JITSU_CONFIGURATOR=http://host.docker.internal:7007/
- JITSU_CLUSTER_ADMIN_TOKEN=myadmin
- JITSU_JITSU_SERVER=http://jitsu:8001/
## For local development ONLY. This forces events to be immediately persisted
## to ClickHouse. For PROD instances, this must be set to 'batch'
- JITSU_DESTINATIONS_CLICKHOUSE_MODE=stream
- QUARKUS_OIDC_AUTH_SERVER_URL=${AUTH_SERVER_URL:-http://keycloak:8080/realms/dotcms}
- QUARKUS_DATASOURCE_DB_KIND=postgresql
- QUARKUS_DATASOURCE_REACTIVE_URL=postgresql://analytics-postgres:5432/${POSTGRESQL_DB:-postgres}
- QUARKUS_DATASOURCE_USERNAME=${POSTGRESQL_USER:-postgres}
- QUARKUS_DATASOURCE_PASSWORD=${POSTGRESQL_PASS:-postgres}
- QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION=drop-and-create
- QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION_CREATE_SCHEMAS=true
- QUARKUS_SWAGGER_UI_ALWAYS_INCLUDE=true
- EXCLUDED_QUERY_PARAMS=${ANALYTICS_EXCLUDED_QUERY_PARAMS:-variantName,redirect}
## Enable this for extended logging and troubleshooting
#- QUARKUS_LOG_LEVEL=DEBUG
- QUARKUS_PROFILE=prod
- QUARKUS_KUBERNETES_CONFIG_ENABLED=false
## If not using the prod profid, the jwks url and issuer need to be set directly.
#- MP_JWT_VERIFY_PUBLICKEY_LOCATION=http://keycloak:8080/realms/dotcms/protocol/openid-connect/certs
#- MP_JWT_VERIFY_ISSUER=http://keycloak:8080/realms/dotcms
## Or, for local testing only, you can set issuer to 'NONE' to not validate
#- MP_JWT_VERIFY_ISSUER=NONE
- ISSUER_URI=${ISSUER_URI:-NONE}
- JWKS_URI=${JWKS_URL:-http://keycloak:8080/realms/dotcms/protocol/openid-connect/certs}
- CLICKHOUSE_URL=http://${CH_USER:-clickhouse_test_user}:${CH_PWD:-clickhouse_password}@ch_server:8123
ports:
- "${DOTCMS_ANALYTICS_HOST_PORT:-8088}:8080"
networks:
- analytics-net
depends_on:
- keycloak
- analytics-postgres
- jitsu
jitsu:
container_name: jitsu
image: jitsucom/server:latest
environment:
- CLUSTER_ADMIN_TOKEN=myadmin
- REDIS_URL=redis://jitsu_redis:6379
- JITSU_CONFIGURATOR_URL=${JITSU_CONFIGURATOR_URL:-http://dotcms-analytics:8080}
- SERVER_PORT=8001
- TERM=xterm-256color
- TLS_SKIP_VERIFY=true
depends_on:
- redis
- ch_server
volumes:
- ./setup/config/dev/jitsu/server/config:/home/eventnative/data/config
restart: always
networks:
- analytics-net
ports:
- "${JITSU_HOST_PORT:-8081}:8001"
redis:
container_name: jitsu_redis
image: redis:6.2.6-bullseye
volumes:
- redis-data:/data
networks:
- analytics-net
restart: always
healthcheck:
test: ["CMD-SHELL", "redis-cli -h localhost -p 6379 PING"]
interval: 1s
timeout: 30s
cube:
container_name: cube
image: cubejs/cube:v1.6.36
ports:
- ${CUBE_HOST_PORT:-4001}:4000
environment:
- CUBEJS_DEV_MODE=true
- CUBEJS_DB_TYPE=clickhouse
- CUBEJS_DB_HOST=${CH_SERVER:-ch_server}
- CUBEJS_DB_NAME=${CH_DB:-clickhouse_test_db}
- CUBEJS_DB_USER=${CH_USER:-clickhouse_test_user}
- CUBEJS_DB_PASS=${CH_PWD:-clickhouse_password}
# Use internal network for JWT validation
- CUBEJS_JWK_URL=${JWKS_URL:-http://keycloak:8080/realms/dotcms/protocol/openid-connect/certs}
- CUBEJS_JWT_AUDIENCE=api-dotcms-analytics-audience
#- CUBEJS_JWT_ISSUER=${AUTH_SERVER_URL:-http://keycloak:8080/realms/dotcms}
- CUBEJS_JWT_ALGS=RS256
- CUBEJS_JWT_CLAIMS_NAMESPACE=https://dotcms.com/analytics
- CUBEJS_LOG_LEVEL=trace
- CUBEJS_REFRESH_WORKER=true
- CUBEJS_SCHEDULED_REFRESH_TIME=true
- CUBEJS_OVERRIDE_CUSTOMER=customer1
- CUBEJS_OVERRIDE_CLUSTER=cluster1
volumes:
- cube_metastore:/cube/conf/.cubestore
- ./setup/config/dev/cube/schema:/cube/conf/schema
- ./setup/config/dev/cube/cube.js:/cube/conf/cube.js
networks:
- analytics-net
depends_on:
- ch_server
- keycloak
ch_server:
container_name: ch_server
image: clickhouse/clickhouse-server:25.8
ports:
- "${CH_HOST_PORT:-8124}:8123"
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8123 || exit 1
environment:
- CLICKHOUSE_DB=${CH_DB:-clickhouse_test_db}
- CLICKHOUSE_USER=${CH_USER:-clickhouse_test_user}
- CLICKHOUSE_PASSWORD=${CH_PWD:-clickhouse_password}
volumes:
- ch_data:/var/lib/clickhouse
- ./setup/db/clickhouse/init-scripts:/docker-entrypoint-initdb.d
networks:
- analytics-net
networks:
dotcms-net:
driver: bridge
analytics-net:
driver: bridge
volumes:
# dotCMS volumes
cms-shared:
dotcms-db-data:
opensearch-data:
# Analytics volumes
analytics-db-data:
ch_data:
redis-data:
redis_ur_data:
cube_metastore:
workspace: