Skip to content

Commit

Permalink
install netcat, amend connectivity test
Browse files Browse the repository at this point in the history
  • Loading branch information
antondlr committed Jun 27, 2024
1 parent d1ce830 commit ab9d745
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docker-assets/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab9d745

Please sign in to comment.