Enforce container boot order 73/19673/1
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 19 Oct 2017 08:33:20 +0000 (10:33 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 19 Oct 2017 08:33:20 +0000 (10:33 +0200)
Make sure that so container is started only
when db is ready to connect

Change-Id: I6ba1d9df7837f482def82d33b90fe5be52c686dd
Issue-ID: SO-208
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
docker-compose.yml

index 65da92f..7cf32df 100644 (file)
@@ -1,4 +1,4 @@
-version: '2'
+version: '2.1'
 networks:
   default:
     driver: bridge
@@ -21,6 +21,10 @@ services:
       options:
         max-size: "30m"
         max-file: "5"
+    healthcheck:
+      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
+      timeout: 20s
+      retries: 10
   mso:
     image: openecomp/mso
     ports:
@@ -35,7 +39,8 @@ services:
     hostname:
       mso.mso.testlab.openecomp.org
     depends_on:
-      - mariadb
+      mariadb:
+        condition: service_healthy
     logging:
       driver: "json-file"
       options: