From d84cde2cc3336dcfbf4a0d8870acf7107a19a92e Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 7 Jan 2020 12:20:06 -0600 Subject: [PATCH 1/2] Ensure dspace container waits until db is accepting connections --- docker-compose.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index a6ce7e55f6..1f2e4043d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,11 +20,15 @@ services: volumes: - assetstore:/dspace/assetstore - ./dspace/src/main/docker-compose/local.cfg:/dspace/config/local.cfg - # Ensure that the database is ready before starting tomcat + # Ensure that the database is ready BEFORE starting tomcat + # 1. While TCP connection to dspacedb port is not available, continue to sleep + # 2. Then, run database migration to init database tables + # 3. Finally, start Tomcat entrypoint: - /bin/bash - '-c' - | + while ! Date: Tue, 7 Jan 2020 14:44:20 -0600 Subject: [PATCH 2/2] Minor fix. Discard any output of TCP connection command, so we don't see initial connection errors. --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1f2e4043d5..fad1a0365c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,14 +21,14 @@ services: - assetstore:/dspace/assetstore - ./dspace/src/main/docker-compose/local.cfg:/dspace/config/local.cfg # Ensure that the database is ready BEFORE starting tomcat - # 1. While TCP connection to dspacedb port is not available, continue to sleep + # 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep # 2. Then, run database migration to init database tables # 3. Finally, start Tomcat entrypoint: - /bin/bash - '-c' - | - while ! /dev/null 2>&1; do sleep 1; done; /dspace/bin/dspace database migrate catalina.sh run dspacedb: