-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
326 lines (305 loc) · 11.5 KB
/
docker-compose.yaml
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
version: "3.9"
services:
##########################################################
# AUTHOR START
##########################################################
# update query limit http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3Dsettings%2Ctype%3DQueryEngineSettings
author:
image: ${AUTHOR_IMAGE}
hostname: author
restart: unless-stopped
healthcheck:
test: curl -u admin:admin --header Referer:localhost --silent --connect-timeout 5 --max-time 5 http://localhost:8080/system/console/bundles.json | grep -q \"state\":\"Installed\" && exit 1 || exit 0
interval: 10s
timeout: 10s
retries: 20
start_period: 1s
ports:
- ${AUTHOR_PORT}:8080
- ${AUTHOR_DEBUG_PORT}:58242
environment:
- TZ
- AEM_RUNMODE=-Dsling.run.modes=author,crx3,crx3tar,dev,dynamicmedia_scene7,nosamplecontent
- AEM_JVM_OPTS=-server -Xms248m -Xmx4524m -XX:MaxDirectMemorySize=256M -XX:+CMSClassUnloadingEnabled -Djava.awt.headless=true -Dorg.apache.felix.http.host=0.0.0.0 -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:58242
- AEM_PROXY_HOST=proxy
volumes:
- author-data:/aem/crx-quickstart/repository
depends_on:
- traefik
labels:
# note that you want this frontened to match the last. otherwise it will match login.${HOST_DOMAIN}"
traefik.frontend.priority: 1
traefik.enable: true
traefik.http.routers.author.rule: "Host(`${AUTHOR_HOST}`)"
traefik.http.routers.author.entrypoints: web
traefik.http.routers.author_https.rule: "Host(`${AUTHOR_HOST}`)"
traefik.http.routers.author_https.tls: true
traefik.http.routers.author_https.entrypoints: websecure
traefik.http.services.author.loadbalancer.server.port: 8080
traefik.http.services.author.loadbalancer.passHostHeader: true
networks:
- mongo-network
- author-network
- publish-network
- dispatcher-network
- internal
- default
##########################################################
# AUTHOR END
##########################################################
##########################################################
# PUBLISH START
##########################################################
publish:
image: ${PUBLISH_IMAGE}
hostname: publish
restart: unless-stopped
healthcheck:
test: curl -u admin:admin --header Referer:localhost --silent --connect-timeout 5 --max-time 5 http://localhost:8080/system/console/bundles.json | grep -q \"state\":\"Installed\" && exit 1 || exit 0
interval: 10s
timeout: 10s
retries: 20
start_period: 30s
ports:
- ${PUBLISH_PORT}:8080
- ${PUBLISH_DEBUG_PORT}:58242
environment:
- TZ
- AEM_RUNMODE=-Dsling.run.modes=publish,crx3,crx3tar,dev,dynamicmedia_scene7,nosamplecontent
- AEM_JVM_OPTS=-server -Xms248m -Xmx1524m -XX:MaxDirectMemorySize=256M -XX:+CMSClassUnloadingEnabled -Djava.awt.headless=true -Dorg.apache.felix.http.host=0.0.0.0 -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:58242
- AEM_PROXY_HOST=proxy
labels:
# note that you want this frontend to match the last. otherwise, it will match login.${HOST_DOMAIN}"
traefik.frontend.priority: 2
traefik.enable: true
traefik.http.routers.publish.rule: "Host(`${PUBLISH_HOST}`)"
traefik.http.routers.publish.entrypoints: web
traefik.http.routers.publish_https.rule: "Host(`${PUBLISH_HOST}`)"
traefik.http.routers.publish_https.tls: true
traefik.http.routers.publish_https.entrypoints: websecure
traefik.http.services.publish.loadbalancer.server.port: 8080
traefik.http.services.publish.loadbalancer.passHostHeader: true
volumes:
- publish-data:/aem/crx-quickstart/repository
networks:
- publish-network
- internal
- default
##########################################################
# PUBLISH END
##########################################################
##########################################################
# DISPATCHER START
##########################################################
dispatcher:
image: ${DISPATCHER_IMAGE}
hostname: dispatcher
restart: unless-stopped
ports:
- ${DISPATCHER_PORT}:80
environment:
- TZ
- AEM_PORT=8080
- AEM_HOST=publish
- DISP_LOG_LEVEL=trace1 #debug
- ENVIRONMENT_TYPE=LOCAL
- AEM_PROXY_HOST=proxy
labels:
# note that you want this frontend to match the last. otherwise, it will match login.${HOST_DOMAIN}"
traefik.frontend.priority: 1
traefik.enable: true
traefik.http.routers.dispatcher.rule: "HostRegexp(`${DISPATCHER_HOST}`, `{subdomain:[a-z]+}.${DISPATCHER_HOST}`)"
traefik.http.routers.dispatcher.entrypoints: web
traefik.http.routers.dispatcher_https.rule: "HostRegexp(`${DISPATCHER_HOST}`, `{subdomain:[a-z]+}.${DISPATCHER_HOST}`)"
traefik.http.routers.dispatcher_https.tls: true
traefik.http.routers.dispatcher_https.entrypoints: websecure
traefik.http.services.dispatcher.loadbalancer.passHostHeader: true
volumes:
- ./dispatcher/src/:/mnt/dev/src/
- ./dispatcher/scripts/fix-symlinks.sh:/docker_entrypoint.d/zzz-fix-symlinks.sh
depends_on:
- proxy
networks:
- publish-network
- dispatcher-network
- internal
- default
##########################################################
# DISPATCHER END
##########################################################
##########################################################
# PROXY START
##########################################################
proxy:
image: ${PROXY_IMAGE}
restart: unless-stopped
hostname: proxy
labels:
# note that you want this frontend to match the last. otherwise, it will match login.${HOST_DOMAIN}"
traefik.frontend.priority: 1
traefik.enable: true
traefik.http.routers.proxy.rule: "Host(`${PROXY_HOST}`)"
traefik.http.routers.proxy.entrypoints: web
traefik.http.routers.proxy_https.rule: "Host(`${PROXY_HOST}`)"
traefik.http.routers.proxy_https.tls: true
traefik.http.routers.proxy_https.entrypoints: websecure
traefik.http.services.proxy.loadbalancer.passHostHeader: true
traefik.http.services.proxy.loadbalancer.server.port: 3128
volumes:
- ./services/proxy/squid.conf:/etc/squid/squid.conf
networks:
- author-network
- publish-network
- dispatcher-network
- internal
- default
##########################################################
# PROXY END
##########################################################
##########################################################
# TRAEFIK START
##########################################################
traefik:
image: ${TRAEFIK_IMAGE}
restart: always
hostname: traefik
environment:
- TZ
security_opt:
- no-new-privileges:true
command:
- "--log.level=${TRAEFIK_LOG_LEVEL}"
- "--accesslog=${TRAEFIK_ACCESS_LOG}"
- "--api.insecure=true" # Don't do that in production!
- "--api.dashboard=true" # Don't do that in production!
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--global.sendAnonymousUsage=true"
# Entrypoints for HTTP, HTTPS, and NX (TCP + UDP)
- "--entrypoints.web.address=:${TRAEFIK_PORT_HTTP}"
- "--entrypoints.websecure.address=:${TRAEFIK_PORT_HTTPS}"
# - "--entrypoints.mongo.address=:${MONGO_PORT}"
# - "--entrypoints.traefik.address=:${TRAEFIK_PORT_DASHBOARD}"
# - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
# - "--entrypoints.web.http.redirections.entryPoint.permanent=true"
# Manual keys
- "--providers.file.directory=/etc/traefik/dynamic_conf"
- "--providers.file.watch=true"
labels:
traefik.frontend.priority: 1
traefik.enable: true
traefik.http.routers.traefikdashboard.rule: "Host(`${TRAEFIK_HOST}`) && ( PathPrefix(`/api`) || PathPrefix(`/dashboard`) )"
traefik.http.routers.traefikdashboard.entrypoints: web
traefik.http.routers.traefikdashboard.service: api@internal
traefik.http.routers.traefikdashboard_https.rule: "Host(`${TRAEFIK_HOST}`) && ( PathPrefix(`/api`) || PathPrefix(`/dashboard`) )"
traefik.http.routers.traefikdashboard_https.entrypoints: websecure
traefik.http.routers.traefikdashboard_https.tls: true
traefik.http.routers.traefikdashboard_https.service: api@internal
traefik.http.services.traefikdashboard.loadbalancer.server.port: 8080
ports:
- ${TRAEFIK_PORT_HTTP}:80
- ${TRAEFIK_PORT_HTTPS}:443
- ${TRAEFIK_PORT_DASHBOARD}:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# Persist certificates, so we can restart as often as needed
- ./services/traefik/certs:/letsencrypt
- ./services/traefik/config/config.yml:/etc/traefik/dynamic_conf/conf.yml:ro
depends_on:
createcert:
condition: service_completed_successfully
networks:
- author-network
- publish-network
- dispatcher-network
- internal
- default
createcert:
image: ${CERTS_IMAGE}
environment:
- TZ
command:
- "${CERTS_COMMAND}"
volumes:
- ./services/traefik/certs:/certs
##########################################################
# TRAEFIK END
##########################################################
##########################################################
# DASHBOARD START
##########################################################
dashboardbuild:
image: ${DASHBOARD_BUILD_IMAGE}
privileged: true
environment:
- TZ
- JEKYLL_ENV=production
- DOMAIN_URL
- GIT_REPO
- GIT_REPO_ADOBE
- GIT_REPO_ICON
- GIT_REPO_TITLE
- GIT_REPO_ADOBE_ICON
- GIT_REPO_ADOBE_TITLE
- TRAEFIK_URL
- TRAEFIK_PORT_HTTP
- TRAEFIK_PORT_HTTPS
- TRAEFIK_PORT_DASHBOARD
- PROXY_URL
- MONGOUI_URL
- AUTHOR_URL
- AUTHOR_PORT
- AUTHOR_DEBUG_PORT
- PUBLISH_URL
- PUBLISH_PORT
- PUBLISH_DEBUG_PORT
- DISPATCHER_URL
- DASHBOARD_URL
- DISPATCHER_HOST
- PAGE_LINKS
- SHOWCASE_LINKS
- AUTHOR_LINKS
- CONSOLE_LINKS
command: bash /srv/jekyll/build.sh
volumes:
- ${DASHBOARD_CONTENT_PATH}:/srv/jekyll:rw
dashboard:
image: ${DASHBOARD_IMAGE}
restart: unless-stopped
working_dir: /content
hostname: dashboard
depends_on:
- traefik
- dashboardbuild
labels:
traefik.frontend.priority: 1
traefik.enable: true
traefik.http.routers.dashboard.rule: "Host(`${DASHBOARD_HOST}`)"
traefik.http.routers.dashboard.entrypoints: web
traefik.http.routers.dashboard_https.rule: "Host(`${DASHBOARD_HOST}`)"
traefik.http.routers.dashboard_https.tls: true
traefik.http.routers.dashboard_https.entrypoints: websecure
traefik.http.services.dashboard.loadbalancer.server.port: 80
traefik.http.services.dashboard.loadbalancer.passHostHeader: true
volumes:
- ${DASHBOARD_CONTENT_PATH}/_site:/content
- ${DASHBOARD_CONFIG_FILE}:/etc/nginx/nginx.conf
environment:
- TZ
networks:
- internal
##########################################################
# DASHBOARD END
##########################################################
networks:
default:
internal:
author-network:
publish-network:
dispatcher-network:
mongo-network:
volumes:
author-data:
authormongo-data:
publish-data:
dispatcher-data: