Skip to content

Commit 3713721

Browse files
committed
Use healthcheck on start-up
1 parent cafa0d6 commit 3713721

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ services:
7474
- IOTA_DEFAULT_RESOURCE= # Default is blank. I'm using MQTT so I don't need a resource
7575
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
7676
healthcheck:
77-
test: curl --fail -s http://iot-agent:${IOTA_NORTH_PORT}/iot/about || exit 1
77+
interval: 5s
78+
7879

7980
# Tutorial acts as a series of dummy IoT Sensors over HTTP
8081
tutorial:

services

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ waitForOrion () {
8888

8989
waitForIoTAgent () {
9090
echo -e "\n⏳ Waiting for \033[1;36mIoT-Agent\033[0m to be available\n"
91-
while [ `docker run --network fiware_default --rm curlimages/curl -s -o /dev/null -w %{http_code} 'http://iot-agent:4041/version'` -eq 000 ]
91+
while ! [ `docker inspect --format='{{.State.Health.Status}}' fiware-iot-agent` == "healthy" ]
92+
9293
do
9394
echo -e "IoT Agent HTTP state: " `curl -s -o /dev/null -w %{http_code} 'http://localhost:4041/version'` " (waiting for 200)"
9495
sleep 1

0 commit comments

Comments
 (0)