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