From 18f1c05879e8d7ac3be94439dc4a1f37d577388d Mon Sep 17 00:00:00 2001
From: Lubomir Bucek <lubomir.bucek@eox.at>
Date: Fri, 17 Jul 2020 12:47:05 +0200
Subject: [PATCH] update emg waiting connected yaml configs

---
 docker-compose.emg.yml   | 15 +++++++++++++--
 docker-compose.vhr18.yml |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/docker-compose.emg.yml b/docker-compose.emg.yml
index 594b7605..807f1e48 100644
--- a/docker-compose.emg.yml
+++ b/docker-compose.emg.yml
@@ -42,7 +42,10 @@ services:
     environment:
       INSTANCE_ID: "prism-view-server_renderer"
       INSTALL_DIR: "/var/www/pvs/dev/"
-      INIT_SCRIPTS: "/configure.sh /init-db.sh"
+      COLLECT_STATIC: "false"
+      INIT_SCRIPTS: "/configure.sh /init-db.sh /initialized.sh"
+      STARTUP_SCRIPTS: "/wait-initialized.sh"
+      WAIT_SERVICES: "database:5432"
     configs:
       - source: init-db
         target: /init-db.sh
@@ -67,6 +70,8 @@ services:
     environment:
       INSTANCE_ID: "prism-view-server_cache"
       RENDERER_HOST: renderer
+      WAIT_SERVICES: "database:5432 renderer:80"
+      WAIT_TIMEOUT: 300  # wait up to 5 minutes
     deploy:
       replicas: 1
     networks:
@@ -88,6 +93,7 @@ services:
     environment:
       INSTANCE_ID: "prism-view-server_seeder"
       RENDERER_HOST: renderer
+      WAIT_SERVICES: "redis:6379 database:5432"
     deploy:
       replicas: 0
     networks:
@@ -100,8 +106,10 @@ services:
       - env/emg.env
       - env/emg_obs.env
       - env/emg_redis.env
+      - env/emg_preprocessor.env
     environment:
       INSTANCE_ID: "prism-view-server_preprocessor"
+      WAIT_SERVICES: "redis:6379"
     deploy:
       replicas: 1
     networks:
@@ -126,7 +134,10 @@ services:
       INSTALL_DIR: "/var/www/pvs/dev/"
       SCALEFACTOR: "1"
       IN_MEMORY: "false"
-      INIT_SCRIPTS: "/configure.sh /init-db.sh"
+      COLLECT_STATIC: "false"
+      INIT_SCRIPTS: "/configure.sh /init-db.sh /initialized.sh"
+      STARTUP_SCRIPTS: "/wait-initialized.sh"
+      WAIT_SERVICES: "redis:6379 database:5432"
     configs:
       - source: init-db
         target: /init-db.sh
diff --git a/docker-compose.vhr18.yml b/docker-compose.vhr18.yml
index 8ee8fd13..8b808a9d 100644
--- a/docker-compose.vhr18.yml
+++ b/docker-compose.vhr18.yml
@@ -106,6 +106,7 @@ services:
       - env/vhr18.env
       - env/vhr18_obs.env
       - env/vhr18_redis.env
+      - env/vhr18_preprocessor.env
     environment:
       INSTANCE_ID: "prism-view-server_preprocessor"
       WAIT_SERVICES: "redis:6379"
-- 
GitLab