Skip to content

Commit

Permalink
Merge pull request #326 from khssnv/fix/healthcheck-by-changed-block-num
Browse files Browse the repository at this point in the history
Fix the health check procedure 👍
  • Loading branch information
Pavel Sheremetev authored Dec 20, 2022
2 parents c9494ed + adfa02d commit ac8dbd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ RUN apt-get update && \
mkdir -p /robonomics/.local/share && \
mkdir /data && \
chown -R robonomics:robonomics /data && \
ln -s /data /robonomics/.local/share/robonomics && \
rm -rf /usr/bin /usr/sbin
ln -s /data /robonomics/.local/share/robonomics

COPY ./healthcheck.sh /usr/bin/
HEALTHCHECK --interval=300s --timeout=75s --start-period=30s --retries=3 \
CMD ["/usr/bin/healthcheck.sh"]

LABEL description="This is the 2nd stage: a very small image where we copy the robonomics binary"
LABEL description="This is the 2nd stage: an image where we copy the robonomics binary"

ARG PROFILE=release
# add binary to docker image
Expand Down
5 changes: 3 additions & 2 deletions scripts/docker/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
set -e

head () {
polkadot-js-api --ws ws://172.28.1.1:9944 query.parachains.heads 100 |\
jq -r .heads
polkadot-js-api --ws ws://127.0.0.1:9944 query.system.number 2>/dev/null |\
tail -3 |\
jq -r .number
}

start=$(head)
Expand Down

0 comments on commit ac8dbd4

Please sign in to comment.