Add healthcheck to oam-controller deployment
[oam.git] / solution / smo / oam / docker-compose.yml
index 57c5553..9d2c5b5 100755 (executable)
@@ -18,6 +18,9 @@ services:
       traefik.http.routers.sdnc-web.rule: Host(`odlux.oam.${SOLUTION_DOMAIN}`)
       traefik.http.routers.sdnc-web.tls: true
       traefik.http.services.sdnc-web.loadbalancer.server.port: ${SDNC_WEB_PORT}
+    depends_on:
+      controller:
+        condition: service_healthy
     networks:
       smo:
 
@@ -25,6 +28,12 @@ services:
     image: ${SDNC_IMAGE}
     container_name: controller
     hostname: controller
+    healthcheck:
+      test: wget -U ${ADMIN_USERNAME}:${ADMIN_PASSWORD} --no-verbose --tries=1 --spider http://localhost:${SDNC_REST_PORT}/ready || exit 1
+      start_period: 60s
+      interval: 10s
+      timeout: 5s
+      retries: 5
     ports:
       - 4334:4334
       - 4335:4335
@@ -66,7 +75,7 @@ services:
       traefik.http.routers.controller.entrypoints: websecure
       traefik.http.routers.controller.rule: Host(`controller.oam.${SOLUTION_DOMAIN}`)
       traefik.http.routers.controller.tls: true
-      traefik.http.services.controller.loadbalancer.server.port: 8181
+      traefik.http.services.controller.loadbalancer.server.port: ${SDNC_REST_PORT}
     networks:
       smo:
       default: