This repository has been archived by the owner on Aug 16, 2018. It is now read-only.
forked from cedadev/esgf-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-classic.yml
404 lines (382 loc) · 14.4 KB
/
docker-compose-classic.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
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# Docker Compose file to start a full ESGF node.
#
# Required env variables:
#
# ESGF_CONFIG : points to the root ESGF configuration directory
# example: export ESGF_CONFIG=/Users/cinquini/ESGF_CONFIG
# ESGF_HOSTNAME: HostName or IP address for apache httpd front-end server
# example: export ESGF_HOSTNAME=my.esgf.node
# example: export ESGF_HOSTNAME=`docker-machine ip`
# ESGF_VERSION: version of ESGF/Docker distribution
# example: export ESGF_VERSION=1.0
# ESGF_DATA_DIR: root of ESGF data directories
version: '3.4'
services:
# Build dependency only
esgf-configure:
image: "${ESGF_HUB}/esgf-configure:${ESGF_VERSION}"
build: ./configure
# Use an entrypoint that exits immediately with success
entrypoint: ["true"]
# Environment variables required for config files
# This uses a YAML anchor so that these are easy to reference elsewhere
environment: &config_env
ESGF_HOSTNAME:
ESGF_DATABASE_HOST: esgf-postgres
# Build dependency only
esgf-tomcat:
image: "${ESGF_HUB}/esgf-tomcat:${ESGF_VERSION}"
build: ./tomcat
# Use an entrypoint that exits immediately with success
entrypoint: ["true"]
# Build dependency only
esgf-django:
image: "${ESGF_HUB}/esgf-django:${ESGF_VERSION}"
build: ./django
# Use an entrypoint that exits immediately with success
entrypoint: ["true"]
# The setup is included here so it can be used with docker-compose run
# The command is modified to a simple quit with 0 exit status
esgf-setup:
image: "${ESGF_HUB}/esgf-setup:${ESGF_VERSION}"
build: ./setup
environment:
ESGF_HOSTNAME:
volumes:
- "$ESGF_CONFIG:/esg"
# Use a command that exits immediately with success
command: ["true"]
# The publisher is included here so it can be used with docker-compose run
# The command is modified to a simple quit with 0 exit status
esgf-publisher:
image: "${ESGF_HUB}/esgf-publisher:${ESGF_VERSION}"
build: ./publisher
environment:
<<: *config_env
ESGF_DATABASE_PASSWORD_FILE: /esg/secrets/database-password
ESGF_TDS_USERNAME: rootAdmin
ESGF_TDS_PASSWORD_FILE: /esg/secrets/rootadmin-password
ESGF_ROOTADMIN_PASSWORD_FILE: /esg/secrets/rootadmin-password
volumes:
- "$ESGF_DATA:/esg/data:ro"
- "tds-content:/esg/content/thredds/esgcet"
# Mount only the secrets we actually need
- "$ESGF_CONFIG/secrets/database-password:/esg/secrets/database-password:ro"
- "$ESGF_CONFIG/secrets/rootadmin-password:/esg/secrets/rootadmin-password:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
# Use a command that exits immediately with success, but don't change the entrypoint
command: ["true"]
esgf-proxy:
image: "${ESGF_HUB}/esgf-proxy:${ESGF_VERSION}"
build: ./proxy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- "$ESGF_CONFIG/certificates/hostcert:/etc/nginx/ssl:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
environment:
ESGF_HOSTNAME:
ESGF_SOLR_UPSTREAM: http://esgf-solr-slave:8983
ESGF_INDEX_NODE_UPSTREAM: http://esgf-index-node:8080
ESGF_TDS_UPSTREAM: http://esgf-tds:8080
ESGF_COG_UPSTREAM: http://esgf-cog:8000
ESGF_ORP_UPSTREAM: http://esgf-orp:8080
ESGF_IDP_UPSTREAM: http://esgf-idp-node:8080
ESGF_SLCS_UPSTREAM: http://esgf-slcs:8000
ESGF_AUTH_UPSTREAM: http://esgf-auth:8000
depends_on:
- esgf-solr-slave
- esgf-index-node
- esgf-tds
- esgf-orp
- esgf-idp-node
- esgf-slcs
- esgf-auth
- esgf-cog
esgf-solr-master:
image: "${ESGF_HUB}/esgf-solr:${ESGF_VERSION}"
build: ./solr
restart: always
ports:
- "8984:8984"
environment:
SOLR_HOME: /esg/solr-home
SOLR_HEAP: 1g
SOLR_SHARD: "master"
SOLR_PORT: "8984"
command:
- "solr-foreground"
- "-p"
- "8984"
- "-s"
- "/esg/solr-home/master-8984"
volumes:
- "solr-home:/esg/solr-home"
- "solr-index:/esg/solr-index"
# FIXME for KUBERNETES: build into the image
- ./solr/config/solr-home:/usr/local/src/solr-home
- ./solr/docker-entrypoint-classic.sh:/usr/local/bin/docker-entrypoint.sh
esgf-solr-slave:
image: "${ESGF_HUB}/esgf-solr:${ESGF_VERSION}"
build: ./solr
restart: always
ports:
- "8983:8983"
environment:
SOLR_HOME: /esg/solr-home
SOLR_HEAP: 1g
SOLR_SHARD: "slave"
SOLR_PORT: "8983"
command:
- "solr-foreground"
- "-p"
- "8983"
- "-s"
- "/esg/solr-home/slave-8983"
volumes:
- "solr-home:/esg/solr-home"
- "solr-index:/esg/solr-index"
# FIXME for KUBERNETES: build into the image
- ./solr/config/solr-home:/usr/local/src/solr-home
- ./solr/docker-entrypoint-classic.sh:/usr/local/bin/docker-entrypoint.sh
esgf-postgres:
image: "${ESGF_HUB}/esgf-postgres:${ESGF_VERSION}"
build: ./postgres
restart: always
environment:
DBSUPER_PASSWORD_FILE: /esg/secrets/database-password
ESGCET_PASSWORD_FILE: /esg/secrets/database-publisher-password
ESGF_ROOTADMIN_EMAIL: "CoG@${ESGF_HOSTNAME}"
ESGF_ROOTADMIN_USERNAME: rootAdmin
ESGF_ROOTADMIN_OPENID: https://${ESGF_HOSTNAME}/esgf-idp/openid/rootAdmin
ESGF_ROOTADMIN_PASSWORD_FILE: /esg/secrets/rootadmin-password
volumes:
# Mount only the secrets we actually need
- "$ESGF_CONFIG/secrets/database-password:/esg/secrets/database-password:ro"
- "$ESGF_CONFIG/secrets/database-publisher-password:/esg/secrets/database-publisher-password:ro"
- "$ESGF_CONFIG/secrets/rootadmin-password:/esg/secrets/rootadmin-password:ro"
- "postgres-data:/var/lib/pgsql/data"
esgf-orp:
image: "${ESGF_HUB}/esgf-orp:${ESGF_VERSION}"
build:
context: ./orp
args:
ESGF_HUB: $ESGF_HUB
ESGF_VERSION: $ESGF_VERSION
restart: always
environment:
<<: *config_env
ESGF_SAML_CERT_FILE: /esg/certificates/hostcert/hostcert.crt
ESGF_SAML_KEY_FILE: /esg/certificates/hostcert/hostcert.key
volumes:
# Mount the host certificate and key for SAML signing
- "$ESGF_CONFIG/certificates/hostcert:/esg/certificates/hostcert:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
depends_on:
- esgf-configure
- esgf-tomcat
esgf-index-node:
image: "${ESGF_HUB}/esgf-index-node:${ESGF_VERSION}"
build:
context: ./index-node
args:
ESGF_HUB: $ESGF_HUB
ESGF_VERSION: $ESGF_VERSION
restart: always
environment:
<<: *config_env
ESGF_SOLR_HOSTNAME: esgf-solr-slave:8983
volumes:
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
# FIXME: build different esgf-index-node image that does not crash when started without cloud option
- "./index-node/scripts/create-indices.sh:/tomcat-init.d/02-create-indices.sh"
depends_on:
- esgf-configure
- esgf-tomcat
- esgf-solr-slave
- esgf-orp
esgf-idp-node:
image: "${ESGF_HUB}/esgf-idp-node:${ESGF_VERSION}"
build:
context: ./idp-node
args:
ESGF_HUB: $ESGF_HUB
ESGF_VERSION: $ESGF_VERSION
restart: always
environment:
<<: *config_env
volumes:
- "$ESGF_CONFIG/secrets/database-password:/esg/config/.esg_pg_pass:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
depends_on:
- esgf-configure
- esgf-tomcat
- esgf-postgres
esgf-tds:
image: "${ESGF_HUB}/esgf-tds:${ESGF_VERSION}"
build:
context: ./tds
args:
ESGF_HUB: $ESGF_HUB
ESGF_VERSION: $ESGF_VERSION
environment:
<<: *config_env
ESGF_COOKIE_SECRET_KEY_FILE: /esg/secrets/shared-cookie-secret-key
ESGF_TDS_ADMIN_PASSWORD_FILE: /esg/secrets/rootadmin-password
volumes:
- "tds-content:/esg/content/thredds/esgcet"
- "$ESGF_DATA:/esg/data:ro"
# Mount only the secrets we actually need
- "$ESGF_CONFIG/secrets/shared-cookie-secret-key:/esg/secrets/shared-cookie-secret-key:ro"
- "$ESGF_CONFIG/secrets/rootadmin-password:/esg/secrets/rootadmin-password:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
depends_on:
- esgf-configure
- esgf-tomcat
- esgf-postgres
esgf-cog:
image: "${ESGF_HUB}/esgf-cog:${ESGF_VERSION}"
build:
context: ./cog
args:
ESGF_HUB: $ESGF_HUB
ESGF_VERSION: $ESGF_VERSION
restart: always
environment:
<<: *config_env
ESGF_COG_TIME_ZONE: "Europe/London"
ESGF_COG_SECRET_KEY_FILE: /esg/secrets/cog-secret-key
volumes:
- "$ESGF_CONFIG/secrets/database-password:/esg/config/.esg_pg_pass:ro"
- "$ESGF_CONFIG/secrets/rootadmin-password:/esg/config/.esgf_pass:ro"
- "$ESGF_CONFIG/secrets/cog-secret-key:/esg/secrets/cog-secret-key:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
#- /Users/cinquini/eclipse-workspace/cog:/usr/local/cog/cog_install
depends_on:
- esgf-configure
- esgf-django
- esgf-postgres
esgf-auth-postgres:
image: "postgres:${POSTGRES_VERSION}"
restart: always
environment:
POSTGRES_USER: authuser
POSTGRES_PASSWORD_FILE: /esg/secrets/auth-database-password
POSTGRES_DB: auth
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
volumes:
- "$ESGF_CONFIG/secrets/auth-database-password:/esg/secrets/auth-database-password:ro"
- "auth-postgres-data:/var/lib/postgresql/data"
esgf-auth:
image: "${ESGF_HUB}/esgf-auth:${ESGF_VERSION}"
build:
context: ./auth
args:
ESGF_HUB: $ESGF_HUB
ESGF_VERSION: $ESGF_VERSION
restart: always
environment:
<<: *config_env
SCRIPT_NAME: /esgf-auth
ESGF_AUTH_SECRET_KEY_FILE: /esg/secrets/auth-secret-key
ESGF_COOKIE_SECRET_KEY_FILE: /esg/secrets/shared-cookie-secret-key
# Database settings
DJANGO_DATABASE_DEFAULT_ENGINE: django.db.backends.postgresql
DJANGO_DATABASE_DEFAULT_NAME: auth
DJANGO_DATABASE_DEFAULT_HOST: esgf-auth-postgres
DJANGO_DATABASE_DEFAULT_PORT: "5432"
DJANGO_DATABASE_DEFAULT_USER: authuser
DJANGO_DATABASE_DEFAULT_PASSWORD_FILE: /esg/secrets/auth-database-password
volumes:
- "$ESGF_CONFIG/secrets/auth-secret-key:/esg/secrets/auth-secret-key:ro"
- "$ESGF_CONFIG/secrets/shared-cookie-secret-key:/esg/secrets/shared-cookie-secret-key:ro"
- "$ESGF_CONFIG/secrets/auth-database-password:/esg/secrets/auth-database-password:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
depends_on:
- esgf-configure
- esgf-django
- esgf-auth-postgres
esgf-slcs-postgres:
image: "postgres:${POSTGRES_VERSION}"
restart: always
environment:
POSTGRES_USER: slcsuser
POSTGRES_PASSWORD_FILE: /esg/secrets/slcs-database-password
POSTGRES_DB: slcs
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
volumes:
- "$ESGF_CONFIG/secrets/slcs-database-password:/esg/secrets/slcs-database-password:ro"
- "slcs-postgres-data:/var/lib/postgresql/data"
esgf-slcs:
image: "${ESGF_HUB}/esgf-slcs:${ESGF_VERSION}"
build:
context: ./slcs
args:
ESGF_HUB: $ESGF_HUB
ESGF_VERSION: $ESGF_VERSION
restart: always
environment:
# Generic Django settings
SCRIPT_NAME: /esgf-slcs
DJANGO_ALLOWED_HOSTS: $ESGF_HOSTNAME
DJANGO_SECRET_KEY_FILE: /esg/secrets/slcs-secret-key
# SLCS database
DJANGO_DATABASE_DEFAULT_ENGINE: django.db.backends.postgresql
DJANGO_DATABASE_DEFAULT_NAME: slcs
DJANGO_DATABASE_DEFAULT_HOST: esgf-slcs-postgres
DJANGO_DATABASE_DEFAULT_PORT: "5432"
DJANGO_DATABASE_DEFAULT_USER: slcsuser
DJANGO_DATABASE_DEFAULT_PASSWORD_FILE: /esg/secrets/slcs-database-password
# ESGF User database
DJANGO_DATABASE_USERDB_ENGINE: django.db.backends.postgresql
DJANGO_DATABASE_USERDB_NAME: esgcet
DJANGO_DATABASE_USERDB_HOST: esgf-postgres
DJANGO_DATABASE_USERDB_PORT: "5432"
DJANGO_DATABASE_USERDB_USER: dbsuper
DJANGO_DATABASE_USERDB_PASSWORD_FILE: /esg/secrets/database-password
# Make the rootAdmin account a superuser
DJANGO_CREATE_SUPERUSER: "1"
DJANGO_SUPERUSER_USERNAME: "rootAdmin"
DJANGO_SUPERUSER_EMAIL: "CoG@${ESGF_HOSTNAME}"
# Other SLCS-specific settings
ESGF_SLCS_URL: "https://${ESGF_HOSTNAME}/esgf-slcs"
ESGF_SLCS_BASIC_AUTH_REALM: $ESGF_HOSTNAME
ONLINECA_CERT_SUBJECT_TEMPLATE: /DC=esgf/CN=$$OPENID
ONLINECA_CERT_FILEPATH: /esg/certificates/slcsca/ca.crt
ONLINECA_KEY_FILEPATH: /esg/certificates/slcsca/ca.key
ONLINECA_TRUSTROOTS_DIR: /esg/certificates/slcsca/trustroots
volumes:
- "$ESGF_CONFIG/secrets/slcs-secret-key:/esg/secrets/slcs-secret-key:ro"
- "$ESGF_CONFIG/secrets/slcs-database-password:/esg/secrets/slcs-database-password:ro"
- "$ESGF_CONFIG/secrets/database-password:/esg/secrets/database-password:ro"
- "$ESGF_CONFIG/certificates/slcsca/ca.crt:/esg/certificates/slcsca/ca.crt:ro"
- "$ESGF_CONFIG/certificates/slcsca/ca.key:/esg/certificates/slcsca/ca.key:ro"
# Just mount an empty volume as the trustroots for now
- "slcs-trustroots:/esg/certificates/slcsca/trustroots/:ro"
# Make sure the trusted certificate bundle is available
- "$ESGF_CONFIG/certificates/esg-trust-bundle.pem:/esg/certificates/esg-trust-bundle.pem:ro"
depends_on:
- esgf-django
- esgf-postgres
- esgf-slcs-postgres
# Use Docker volumes to store persistent data
volumes:
zk-data:
zk-datalog:
solr-home:
solr-index:
postgres-data:
tds-content:
slcs-postgres-data:
slcs-trustroots:
auth-postgres-data: