-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
306 lines (291 loc) · 9.94 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
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
version: '3'
volumes:
# (Auto-generated) secrets for...
# ... the proxy container
secrets-certs-proxy:
# ... the certificate authority (private key(s) for CA)
secrets-certs-ca-private:
# ... the certificate authority cert(s)
secrets-certs-ca-shared:
# ... the ldap container
secrets-ldap:
# ... read-only (bind) credentials for ldap
secrets-ldap-bind:
# ... the keycloak container
secrets-keycloak:
# ... the crowd container
secrets-crowd:
# ... the bitbucket container
secrets-bitbucket:
# ... secrets shared between bitbucket and crowd containers
secrets-crowd-bitbucket:
# ... the jira container
secrets-jira:
# ... the artifactory container
secrets-artifactory:
# ... the cas-proxy container
secrets-cas-proxy:
# Keycloak server storage
keycloak-data:
# Keycloak storage for custom providers
keycloak-providers:
# Crowd server storage
crowd-data:
# Bitbucket server storage
bitbucket-data:
# Jira server storage
jira-data:
# Artifactory server storage
artifactory-data:
services:
# Container used to auto-generate secrets (any time the volumes are wiped)
secrets:
hostname: "secrets.${ENV_DOMAIN}"
build: secrets
environment:
ENV_DOMAIN: "$ENV_DOMAIN"
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- "./ldap:/opt/ldap-init:ro"
- "secrets-certs-ca-private:/secrets/certs/ca-private:rw"
- "secrets-certs-ca-shared:/secrets/certs/ca-shared:rw"
- "secrets-certs-proxy:/secrets/certs/proxy:rw"
- "secrets-ldap:/secrets/ldap:rw"
- "secrets-ldap-bind:/secrets/ldap-bind:rw"
- "secrets-keycloak:/secrets/keycloak:rw"
- "secrets-crowd:/secrets/crowd:rw"
- "secrets-bitbucket:/secrets/bitbucket:rw"
- "secrets-crowd-bitbucket:/secrets/crowd-bitbucket:rw"
- "secrets-jira:/secrets/jira:rw"
- "secrets-artifactory:/secrets/artifactory:rw"
- "secrets-cas-proxy:/secrets/certs/cas-proxy:rw"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.6"
proxy:
hostname: "proxy.${ENV_DOMAIN}"
image: haproxy:2.7.1
environment:
ENV_DOMAIN: "$ENV_DOMAIN"
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- ./proxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
- "secrets-certs-ca-shared:/secrets/certs/ca-shared:ro"
- "secrets-certs-proxy:/secrets/certs/proxy:ro"
expose:
- "443"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.8"
aliases:
- ldap-ui.proxy.${ENV_DOMAIN}
- keycloak.proxy.${ENV_DOMAIN}
- crowd.proxy.${ENV_DOMAIN}
- bitbucket.proxy.${ENV_DOMAIN}
depends_on:
secrets:
condition: service_completed_successfully
cas-proxy:
hostname: "cas-proxy.${ENV_DOMAIN}"
#image: "httpd:2.4.58"
build: cas-proxy
environment:
ENV_DOMAIN: "$ENV_DOMAIN"
entrypoint: [ "/bin/bash", "/auth-demo-entrypoint.sh" ]
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
expose:
- "443"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.13"
aliases:
- "artifactory.cas.${ENV_DOMAIN}"
volumes:
- "secrets-cas-proxy:/secrets/certs/secrets-cas-proxy:ro"
- "secrets-certs-ca-shared:/secrets/certs/ca-shared:ro"
depends_on:
secrets:
condition: service_completed_successfully
ldap:
hostname: "ldap.${ENV_DOMAIN}"
image: osixia/openldap:1.5.0
environment:
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.com"
LDAP_BASE_DN: "dc=example,dc=com"
LDAP_SEED_INTERNAL_LDIF_PATH: "/secrets/ldap/ldap-init.ldif"
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- "./ldap:/opt/ldap-init:ro"
# Load my-secrets.yaml as an environment file
- "secrets-ldap:/container/environment/01-custom:ro"
- "secrets-ldap:/secrets/ldap:ro"
healthcheck:
test: ["CMD", "ldapwhoami", "-D", "cn=admin,dc=example,dc=com", "-y", "/secrets/ldap/admin_password", "-H", "ldap://ldap:389"]
interval: 15s
timeout: 5s
retries: 4
start_period: 10s
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.2"
depends_on:
secrets:
condition: service_completed_successfully
ldap-ui:
hostname: "ldap-ui.${ENV_DOMAIN}"
# NOTE: There isn't a tagged version near as new as ":latest", so I'm leaving it as ":latest".
# That being said, this base image looks like abandonware (2 years old).
image: osixia/phpldapadmin:latest
environment:
PHPLDAPADMIN_LDAP_HOSTS: "ldap.${ENV_DOMAIN}"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.5"
depends_on:
secrets:
condition: service_completed_successfully
# NOTE: This container is only necessary because we are installing the CAS provider for Keycloak
keycloak-init:
hostname: "keycloak-init.${ENV_DOMAIN}"
build: keycloak-init
environment:
# NOTE: This version must be in sync with the keycloak container
KEYCLOAK_VERSION: "23.0.6"
KEYCLOAK_PROVIDERS_DIR: "/keycloak-providers"
volumes:
- "keycloak-providers:/keycloak-providers:rw"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.12"
keycloak:
hostname: "keycloak.${ENV_DOMAIN}"
# NOTE: This version must be in sync with the keycloak-init container
image: keycloak/keycloak:23.0.6
environment:
# NOTE: After upgrading from Keycloak v16 to v23, we have to explicitly
# navigate to /auth/ to access the KeyCloak pages.
# The default configuration variables also do not behave as expected.
# See discussions:
# * https://github.com/keycloak/keycloak/issues/14666
# * https://github.com/keycloak/keycloak/discussions/10274
# NOTE: We upgraded Keycloak from v16 to v23 in order to support the CAS provider.
KC_HTTP_RELATIVE_PATH: "/auth"
KC_HOSTNAME_URL: "https://keycloak.proxy.${ENV_DOMAIN}/auth/"
KC_HOSTNAME_STRICT: "false"
KC_HOSTNAME_ADMIN_URL: "https://keycloak.proxy.${ENV_DOMAIN}/auth/"
KC_PROXY: "edge"
entrypoint: [ "/bin/bash", "/auth-demo-entrypoint.sh" ]
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- "./keycloak/entrypoint.sh:/auth-demo-entrypoint.sh:ro"
- "secrets-keycloak:/secrets/keycloak:ro"
- "keycloak-data:/opt/keycloak/data:rw"
- "keycloak-providers:/opt/keycloak/providers:rw"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.7"
depends_on:
secrets:
condition: service_completed_successfully
keycloak-init:
condition: service_completed_successfully
crowd:
hostname: "crowd.${ENV_DOMAIN}"
image: atlassian/crowd:5.1.1
environment:
CROWD_DB_URL: jdbc:postgresql://crowd-db:5432/crowd
CROWD_DB_USER: postgres
CROWD_DB_PASSWORD: password
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- crowd-data:/var/atlassian/application-data/crowd
# This adds trust of the reverse proxy
- ./crowd/server.xml:/opt/atlassian/crowd/apache-tomcat/conf/server.xml:ro
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.4"
depends_on:
secrets:
condition: service_completed_successfully
bitbucket:
hostname: "bitbucket.${ENV_DOMAIN}"
image: atlassian/bitbucket:8.7.0
environment:
SERVER_PROXY_NAME: "bitbucket.proxy.${ENV_DOMAIN}"
SERVER_PROXY_PORT: "443"
SERVER_SCHEME: "https"
SERVER_SECURE: "true"
# "javax.net.ssl.trustStore":
# Enable trust of our our self-signed CA
# (not technically necessary at the time of this writing)
JVM_SUPPORT_RECOMMENDED_ARGS: >-
-Djavax.net.ssl.trustStore=/secrets/certs/ca-shared/cacerts.jks
-Djavax.net.ssl.trustStorePassword=changeit
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- "bitbucket-data:/var/atlassian/application-data/bitbucket:rw"
- "secrets-certs-ca-shared:/secrets/certs/ca-shared:ro"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.3"
depends_on:
secrets:
condition: service_completed_successfully
jira:
hostname: "jira.${ENV_DOMAIN}"
image: atlassian/jira-software:9.3.2
environment:
ATL_PROXY_NAME: "jira.proxy.${ENV_DOMAIN}"
ATL_PROXY_PORT: "443"
ATL_TOMCAT_SCHEME: "https"
ATL_TOMCAT_SECURE: "true"
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- "jira-data:/var/atlassian/application-data/jira:rw"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.9"
depends_on:
secrets:
condition: service_completed_successfully
artifactory:
hostname: "artifactory.${ENV_DOMAIN}"
# The "Pro" version is required for SAML/OAuth support
image: releases-docker.jfrog.io/jfrog/artifactory-pro:7.49.6
security_opt:
# Disable SElinux for volume mounts (since we're using a host mount)
- "label=disable"
volumes:
- "artifactory-data:/var/opt/jfrog/artifactory:rw"
networks:
network:
ipv4_address: "${ENV_IP_PREFIX}.10"
depends_on:
secrets:
condition: service_completed_successfully
networks:
network:
driver: bridge
ipam:
config:
# NOTE: We set static IPs because Crowd depends upon an IP whitelist.
# Otherwise we would have to re-set the whitelist on every restart.
- subnet: "${ENV_IP_PREFIX}.0/16"
gateway: "${ENV_IP_PREFIX}.1"