From ab9d745fc0206cd0edef57b0a30904fbd203c601 Mon Sep 17 00:00:00 2001 From: antondlr Date: Thu, 27 Jun 2024 06:31:13 +0200 Subject: [PATCH] install netcat, amend connectivity test --- Dockerfile | 2 +- docker-assets/docker-entrypoint.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86b73238..c586dd49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ FROM $node_image AS production ENV NODE_ENV=production RUN npm install --global pm2; \ apt update; \ - apt install -y nginx openssl curl + apt install -y nginx openssl curl ncat RUN rm /etc/nginx/sites-enabled/default; \ ln -s /app/docker-assets/siren-http.conf /etc/nginx/conf.d/siren-http.conf diff --git a/docker-assets/docker-entrypoint.sh b/docker-assets/docker-entrypoint.sh index be1fc7bc..51610d80 100755 --- a/docker-assets/docker-entrypoint.sh +++ b/docker-assets/docker-entrypoint.sh @@ -15,7 +15,11 @@ set +a # if bn/vc api unreachable, print message and exit tests="${BEACON_URL} ${VALIDATOR_URL}" for test in $tests; do - nc -z "${test#*//}" + host="${test#*//}" + host="${host%%:*}" + port="${test##*:}" + nc -z $host $port + if [ $? -eq 1 ]; then printf "${test} unreachable, check settings and connection\n" fail=true