Skip to content

Commit

Permalink
Changes for docker end point
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmishra2005 committed Aug 16, 2024
1 parent 642d75e commit 1d865e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ RUN apt-get -qq update && \
unzip \
wget

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

# Configure sccache
ENV SCCACHE_VERSION=0.5.4
RUN wget -q https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz \
Expand Down
15 changes: 15 additions & 0 deletions healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

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

start=$(head)
sleep 60
end=$(head)

[ "$start" != "$end" ]

0 comments on commit 1d865e8

Please sign in to comment.