forked from ESGF/esgf-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-stack.yml
279 lines (259 loc) · 8.26 KB
/
docker-stack.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
# Docker compose file to start a full ESGF node as a distributed stack
# 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-node.esgf.org
# example: export ESGF_HOSTNAME=`docker-machine ip`
# ESGF_VERSION: version of ESGF/Docker distribution
# example: export ESGF_VERSION=1.2
# SOLR_DATA: location of Solr index
# example: export SOLR_DATA=/esg/solr-index
# COG_DATA: location of CoG site data
# example: export COG_DATA=/usr/local/cog/cog_config
# TDS_DATA: location of TDS catalogs
# example: export TDS_DATA=/esg/content/thredds
# PG_DATA: location od postgres database and configuration
# example: export PG_DATA=/var/lib/pgsql/data
# ESGF_DATA_ARCHIVE: location of science data
# example: export ESGF_DATA_ARCHIVE=/esgf/data_archive
#
# Services deployment:
# - front_node: httpd daemon, cog, and visualizer
# - db_node: postgres
# - index_node: esgf-search web application runnning within Tomcat
# - idp_node: esgf-idp web application running within Tomcat
# - data_node: TDS and esg-orp applications running within Tomcat
# - solr_node: Solr search engine running within Jetty
version: '3'
networks:
# network to keep postgres database isolated
dbnetwork:
services:
# ESGF postgres database
esgf-postgres:
image: esgfhub/esgf-postgres:${ESGF_VERSION}
ports:
- "5432:5432"
networks:
- dbnetwork
volumes:
#- $PG_DATA:/var/lib/pgsql/data
- pg_data:/var/lib/pgsql/data
deploy:
placement:
constraints: [node.labels.esgf_db_node == true]
# CoG
# data container to hold CoG source code and python virtual environment
esgf-cog:
image: esgfhub/esgf-cog:${ESGF_VERSION}
ports:
- "8000:8000"
volumes:
- cog_install_dir:/usr/local/cog/cog_install
- cog_venv:/usr/local/cog/venv
#- $COG_DATA:/usr/local/cog/cog_config
- cog_data:/usr/local/cog/cog_config
- $ESGF_CONFIG/httpd/certs/:/etc/certs/
- $ESGF_CONFIG/httpd/conf/esgf-httpd.conf:/etc/httpd/conf.d/esgf-httpd.conf
- $ESGF_CONFIG/grid-security/certificates/:/etc/grid-security/certificates/
- $ESGF_CONFIG/esg/config/:/esg/config/
#command: $ESGF_HOSTNAME true true # ESGF=true, keep django server runnining on port 8000
command: $ESGF_HOSTNAME true false # ESGF=true, django server running on port 8000 = false
depends_on:
- esgf-postgres
networks:
- dbnetwork
environment:
- COG_DIR=/usr/local/cog
- COG_INSTALL_DIR=/usr/local/cog/cog_install
- COG_CONFIG_DIR=/usr/local/cog/cog_config
- ESGF_HOSTNAME
# flag to execute CoG initialization, defaults to true, may be overridden from shell environment before starting docker-compose
- ${INIT:-true}
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.labels.esgf_front_node == true]
esgf-solr:
image: esgfhub/esgf-solr:${ESGF_VERSION}
ports:
- "8983:8983"
- "8984:8984"
volumes:
- solr_data:/esg/solr-index
- $ESGF_CONFIG/esg/config/esgf_shards_static.xml:/esg/config/esgf_shards_static.xml
networks:
- default
deploy:
replicas: 1
placement:
constraints: [node.labels.esgf_solr_node == true]
esgf-index-node:
image: esgfhub/esgf-index-node:${ESGF_VERSION}
ports:
- "8081:8080"
- "8444:8443"
depends_on:
- esgf-solr
volumes:
- $ESGF_CONFIG/esg/config/:/esg/config/
- $ESGF_CONFIG/esg/config/tomcat/esg-truststore.ts:/usr/java/latest/jre/lib/security/jssecacerts
networks:
- default
deploy:
replicas: 1
placement:
constraints: [node.labels.esgf_index_node == true]
esgf-idp-node:
image: esgfhub/esgf-idp-node:${ESGF_VERSION}
ports:
- "8082:8080"
- "8445:8443"
networks:
- default
- dbnetwork
volumes:
- $ESGF_CONFIG/esg/config/:/esg/config/
- $ESGF_CONFIG/esg/config/tomcat/esg-truststore.ts:/usr/java/latest/jre/lib/security/jssecacerts
depends_on:
- esgf-postgres
deploy:
replicas: 1
placement:
constraints: [node.labels.esgf_idp_node == true]
esgf-data-node:
image: esgfhub/esgf-data-node:${ESGF_VERSION}
ports:
- "8083:8080"
- "8446:8443"
networks:
- default
- dbnetwork
volumes:
- tds_data:/esg/content/thredds
- $ESGF_CONFIG/esg/config/:/esg/config/
- $ESGF_CONFIG/webapps/thredds/WEB-INF/web.xml:/usr/local/tomcat/webapps/thredds/WEB-INF/web.xml
- $ESGF_CONFIG/esg/config/tomcat/esg-truststore.ts:/usr/java/latest/jre/lib/security/jssecacerts
#- $ESGF_DATA_ARCHIVE:/esg/data_archive
environment:
- ESGF_HOSTNAME
depends_on:
- esgf-postgres
deploy:
replicas: 1
placement:
constraints: [node.labels.esgf_data_node == true]
esgf-httpd:
image: esgfhub/esgf-httpd:${ESGF_VERSION}
entrypoint: /usr/local/bin/docker-entrypoint.sh
volumes:
- cog_install_dir:/usr/local/cog/cog_install
- cog_venv:/usr/local/cog/venv
- cog_data:/usr/local/cog/cog_config
- $ESGF_CONFIG/httpd/certs/:/etc/certs/
- $ESGF_CONFIG/httpd/conf/esgf-httpd.conf:/etc/httpd/conf.d/esgf-httpd.conf
- $ESGF_CONFIG/grid-security/certificates/:/etc/grid-security/certificates/
- $ESGF_CONFIG/esg/config/:/esg/config/
# - esgf-node-manager
environment:
- SSL_CERT_DIR=/etc/grid-security/certificates
- COG_CONFIG_DIR=/usr/local/cog/cog_config
- ESGF_HOSTNAME
ports:
- "80:80"
- "443:443"
depends_on:
- esgf-cog
# - esgf-node-manager
# httpd URLs must use hostname=$ESGF_HOSTNAME
networks:
default:
aliases:
- "${ESGF_HOSTNAME}"
dbnetwork: {}
deploy:
replicas: 1
placement:
constraints: [node.labels.esgf_front_node == true]
esgf-slcs:
command: ["-sn", "$ESGF_HOSTNAME", "-ds", "rootAdmin", "-sdn", "slcs", "-sdh", "slcs-postgres", "-sdu", "dbsuper", "-udn", "esgcet", "-udh", "esgf-postgres", "-udu", "dbsuper", "--static-url", "https://$ESGF_HOSTNAME/slcs-static/", "--url-prefix", "slcs", "--use-x-forwarded-host"]
depends_on:
- slcs-postgres
- slcs-nginx
image: esgfhub/esgf-slcs:${ESGF_VERSION}
networks:
- default
- dbnetwork
ports:
- "5000:5000"
volumes:
- "slcs_static_web:/var/www/static"
- "$ESGF_CONFIG/slcs/conf/db/:/usr/local/esgf-slcs-server/conf/db"
- "$ESGF_CONFIG/slcs/conf/ca/:/usr/local/esgf-slcs-server/conf/ca"
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.labels.esgf_idp_node == true]
slcs-nginx:
image: nginx
networks:
- default
- dbnetwork
volumes:
- "slcs_static_web:/usr/share/nginx/html"
- "$ESGF_CONFIG/slcs/conf/nginx/nginx.conf:/etc/nginx/conf.d/default.conf"
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.labels.esgf_idp_node == true]
slcs-postgres:
environment:
- POSTGRES_PASSWORD=changeit
- POSTGRES_USER=dbsuper
- POSTGRES_DB=slcs
- POSTGRES_INITDB_ARGS=--encoding=UTF-8
image: postgres
networks:
- default
- dbnetwork
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.labels.esgf_idp_node == true]
# useful visualizer container, not really needed
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
stop_grace_period: 1m30s
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role == manager]
# Use Docker volumes to store persistent data
# that needs to be shared across services
# (which must be co-located on the same node).
# When services are first started,
# volumes are initialized with content from directory in container
volumes:
# cog source directory
cog_install_dir:
# cog venv directory
cog_venv:
# cog site data
cog_data:
# postgres database
pg_data:
# solr indexes
solr_data:
# TDS catalogs
tds_data:
# SLCS web pages
slcs_static_web: