Change-Id: I6bee107efe96003c2eb69a271df9db28ad896379
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
ENV OSMLCM_MESSAGE_HOST kafka
ENV OSMLCM_MESSAGE_PORT 9092
+HEALTHCHECK --interval=30s --timeout=140s --retries=1 \
+ CMD python3 /usr/lib/python3/dist-packages/osm_lcm/lcm.py --health-check || exit 1
+
+
# Run app.py when the container launches
CMD ["python3", "/usr/lib/python3/dist-packages/osm_lcm/lcm.py"]
#!/bin/sh
-WAIT_TIME=60
-NUM_SERVICES_WITH_HEALTH=3
-SERVICES_WITH_HEALTH="nbi ro kafka"
+WAIT_TIME=180 # LCM healthcheck needs 140 senconds
+SERVICES_WITH_HEALTH="nbi ro zookeeper lcm"
+NUM_SERVICES_WITH_HEALTH=$(echo $SERVICES_WITH_HEALTH | wc -w)
while getopts "w:s:n:c:" o; do
case "${o}" in
time=0
-step=1
+step=2
while [ $time -le "$WAIT_TIME" ]; do
if [ "$(docker ps | grep " ${STACK_NAME}_" | grep -i healthy | wc -l)" -ge "$NUM_SERVICES_WITH_HEALTH" ]; then
exit 0