From 16238be912a6870461952adbee9fa2167dfb36ef Mon Sep 17 00:00:00 2001 From: rbuisson Date: Tue, 16 Jul 2019 15:16:04 +0200 Subject: [PATCH] 258: Wait for PostgreSQL before starting Odoo --- 11.0/Dockerfile | 1 + 11.0/entrypoint.sh | 3 +++ 12.0/Dockerfile | 1 + 12.0/entrypoint.sh | 3 +++ 13.0/Dockerfile | 1 + 13.0/entrypoint.sh | 3 +++ 6 files changed, 12 insertions(+) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index f8f56c8..080e08d 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -13,6 +13,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ diff --git a/11.0/entrypoint.sh b/11.0/entrypoint.sh index 4f0ef59..b6401f7 100755 --- a/11.0/entrypoint.sh +++ b/11.0/entrypoint.sh @@ -23,6 +23,9 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +# Wait for the database to be up +wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s + case "$1" in -- | odoo) shift diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 8103ab6..6f8f85f 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -13,6 +13,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ diff --git a/12.0/entrypoint.sh b/12.0/entrypoint.sh index 4f0ef59..b6401f7 100755 --- a/12.0/entrypoint.sh +++ b/12.0/entrypoint.sh @@ -23,6 +23,9 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +# Wait for the database to be up +wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s + case "$1" in -- | odoo) shift diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 44d25bd..ea22d90 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ diff --git a/13.0/entrypoint.sh b/13.0/entrypoint.sh index 4f0ef59..b6401f7 100755 --- a/13.0/entrypoint.sh +++ b/13.0/entrypoint.sh @@ -23,6 +23,9 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +# Wait for the database to be up +wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s + case "$1" in -- | odoo) shift