3131version : " 3.9"
3232
3333services :
34+ # Starts Elasticsearch
35+ elasticsearch :
36+ profiles : ["dev-api", "dev-loader", "pds-core-registry", "int-registry-batch-loader", "os"]
37+ image : ${ES_IMAGE}
38+ ulimits :
39+ nofile :
40+ soft : 65536
41+ hard : 65536
42+ hostname : elasticsearch
43+ container_name : elasticsearch
44+ environment :
45+ - discovery.type=${ES_DISCOVERY_TYPE}
46+ - _JAVA_OPTIONS=-XX:-UseContainerSupport
47+ # Uncomment the following environment variable to use OpenSearch without security
48+ # - plugins.security.disabled=true
49+ volumes :
50+ - ./certs/node1.pem:/usr/share/opensearch/config/esnode.pem
51+ - ./certs/node1-key.pem:/usr/share/opensearch/config/esnode-key.pem
52+ - ./certs/root-ca.pem:/usr/share/opensearch/config/root-ca.pem
53+ - ./default-config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml
54+ ports :
55+ - " 9200:9200"
56+ - " 9600:9600" # required for Performance Analyzer
57+ healthcheck :
58+ test :
59+ - CMD-SHELL
60+ - curl --insecure -f https://elasticsearch:9200/_cluster/health -u admin:admin
61+ interval : 10s
62+ timeout : 2s
63+ retries : 50
64+ networks :
65+ - pds
3466
35- # Executes the Registry Loader component, which contains Harvest and Registry Manager
36- registry-loader :
37- profiles : ["pds-batch-loader"]
67+ # Initializes Elasticsearch by creating registry and data dictionary indices by utilizing the Registry Loader
68+ elasticsearch-init :
69+ profiles : ["dev-api", " pds-core-registry", "int-registry -batch-loader"]
3870 image : ${REG_LOADER_IMAGE}
3971 environment :
4072 - ES_URL=${ES_URL}
4173 volumes :
42- - ${HARVEST_JOB_CONFIG_FILE}:/cfg/harvest-config.xml
43- - ${REG_DATA_VOLUME}:${CONTAINER_HARVEST_data-volume}
74+ - ./scripts/elasticsearch-init.sh:/usr/local/bin/elasticsearch-init.sh
75+ - ./scripts/aliases:/usr/local/bin/aliases
4476 - ./default-config/es-auth.cfg:/etc/es-auth.cfg
45- - ./default-config/local-registry .xml:/etc/local-registry .xml
77+ - ./default-config/local_registry .xml:/etc/local_registry .xml
4678 networks :
4779 - pds
80+ entrypoint : ["bash", "/usr/local/bin/elasticsearch-init.sh"]
81+ depends_on :
82+ elasticsearch :
83+ condition : service_healthy
4884
4985 # Downloads and harvests test data with the Registry loader
5086 registry-loader-test-init :
@@ -57,12 +93,13 @@ services:
5793 - TEST_DATA_LIDVID=${TEST_DATA_LIDVID}
5894 volumes :
5995 - ${REG_DATA_VOLUME}:${CONTAINER_HARVEST_DATA_DIR}
60- - ./scripts/registry-loader-waits-for-elasticsearch.sh:/usr/local/bin/registry-loader-waits-for-elasticsearch.sh
6196 - ./default-config/es-auth.cfg:/etc/es-auth.cfg
6297 - ./custom-datasets.tar.gz:/etc/custom-datasets.tar.gz
6398 networks :
6499 - pds
65- entrypoint : /usr/local/bin/registry-loader-waits-for-elasticsearch.sh
100+ depends_on :
101+ elasticsearch-init :
102+ condition : service_completed_successfully
66103
67104 # Runs provenance script
68105 registry-sweepers :
@@ -81,43 +118,7 @@ services:
81118 registry-loader-test-init :
82119 condition : service_completed_successfully
83120
84- # Starts Elasticsearch
85- elasticsearch :
86- profiles : ["dev-api", "dev-loader", "pds-core-registry", "int-registry-batch-loader", "os"]
87- image : ${ES_IMAGE}
88- ulimits :
89- nofile :
90- soft : 65536
91- hard : 65536
92- environment :
93- - discovery.type=${ES_DISCOVERY_TYPE}
94- # Uncomment the following environment variable to use OpenSearch without security
95- # - plugins.security.disabled=true
96- volumes :
97- - ./certs/node1.pem:/usr/share/opensearch/config/esnode.pem
98- - ./certs/node1-key.pem:/usr/share/opensearch/config/esnode-key.pem
99- - ./certs/root-ca.pem:/usr/share/opensearch/config/root-ca.pem
100- - ./default-config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml
101- ports :
102- - " 9200:9200"
103- - " 9600:9600" # required for Performance Analyzer
104- networks :
105- - pds
106121
107- # Initializes Elasticsearch by creating registry and data dictionary indices by utilizing the Registry Loader
108- elasticsearch-init :
109- profiles : ["dev-api", "pds-core-registry", "int-registry-batch-loader"]
110- image : ${REG_LOADER_IMAGE}
111- environment :
112- - ES_URL=${ES_URL}
113- volumes :
114- - ./scripts/elasticsearch-init.sh:/usr/local/bin/elasticsearch-init.sh
115- - ./scripts/aliases:/usr/local/bin/aliases
116- - ./default-config/es-auth.cfg:/etc/es-auth.cfg
117- - ./default-config/local_registry.xml:/etc/local_registry.xml
118- networks :
119- - pds
120- entrypoint : ["bash", "/usr/local/bin/elasticsearch-init.sh"]
121122
122123 # Starts the Registry API
123124 registry-api :
@@ -131,10 +132,24 @@ services:
131132 volumes :
132133 # make volume match how the spring-boot plugin deploys in docker
133134 - ${REG_API_APP_PROPERTIES_FILE}:/workspace/BOOT-INF/classes/application.properties
134- - ./scripts/registry-api-waits-for-elasticsearch .sh:/usr/local/registry-api-service/registry-api-waits-for-elasticsearch .sh
135+ - ./scripts/registry-api.sh:/usr/local/registry-api-service/registry-api.sh
135136 networks :
136137 - pds
137- command : /usr/local/registry-api-service/registry-api-waits-for-elasticsearch.sh
138+ command : /usr/local/registry-api-service/registry-api.sh
139+ healthcheck :
140+ test :
141+ - CMD
142+ - curl
143+ - -f
144+ - http://localhost:8080/health
145+ interval : 10s
146+ timeout : 2s
147+ retries : 50
148+ depends_on :
149+ registry-sweepers :
150+ condition : service_completed_successfully
151+
152+
138153
139154 # Executes an nginx service to expose the PDS4 archive
140155 registry-web-archive :
@@ -147,6 +162,9 @@ services:
147162 - ${REG_DATA_VOLUME}:/usr/share/nginx/html/archive
148163 networks :
149164 - pds
165+ depends_on :
166+ registry-loader-test-init :
167+ condition : service_completed_successfully
150168
151169 # Executes Registry API integration test as a Postman collection with test data
152170 reg-api-integration-test :
@@ -206,13 +224,31 @@ services:
206224 profiles : ["pds-core-registry", "int-registry-batch-loader", "int-registry-service-loader"]
207225 image : ${PROXYCRYPT_IMAGE}
208226 environment :
209- - PROXY_URL=https://registry-api:8080/
227+ - PROXY_URL=https://${COMPOSE_PROJECT_NAME}- registry-api-1 :8080/
210228 - PROXY_PATH=/api/search/1/
211229 - PROXY_PORT=443
212230 ports :
213231 - " 443:443"
214232 networks :
215233 - pds
234+ depends_on :
235+ registry-api :
236+ condition : service_healthy
237+
238+
239+ # Executes the Registry Loader component, which contains Harvest and Registry Manager
240+ registry-loader :
241+ profiles : ["pds-batch-loader"]
242+ image : ${REG_LOADER_IMAGE}
243+ environment :
244+ - ES_URL=${ES_URL}
245+ volumes :
246+ - ${HARVEST_JOB_CONFIG_FILE}:/cfg/harvest-config.xml
247+ - ${REG_DATA_VOLUME}:${CONTAINER_HARVEST_data-volume}
248+ - ./default-config/es-auth.cfg:/etc/es-auth.cfg
249+ - ./default-config/local-registry.xml:/etc/local-registry.xml
250+ networks :
251+ - pds
216252
217253volumes :
218254 data-volume :
0 commit comments