Adding and enabling HEALTHCHECK

This commit is contained in:
Leopere 2019-04-28 17:26:58 -04:00 committed by Leopere
parent 409586c45e
commit 77ee9dc39d
2 changed files with 5 additions and 3 deletions

View file

@ -9,6 +9,7 @@ RUN apt-get update && \
WORKDIR /
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY ./stuff/start.sh start
COPY ./stuff/healthcheck.sh healthcheck
RUN curl -L -o /chainquery.zip $(curl -s https://api.github.com/repos/lbryio/chainquery/releases | grep -F 'Linux_x86_64.zip' | grep download | head -n 1 | cut -d'"' -f4) && \
unzip /chainquery.zip && \
rm /chainquery.zip
@ -17,7 +18,9 @@ FROM ubuntu:18.04 as app
ADD https://raw.githubusercontent.com/lbryio/chainquery/master/config/default/chainqueryconfig.toml /etc/lbry/chainqueryconfig.toml.orig
RUN adduser chainquery --gecos GECOS --shell /bin/bash --disabled-password --home /home/chainquery && \
chown -R chainquery:chainquery /etc/lbry
COPY --from=prep /chainquery /start /usr/bin/
COPY --from=prep ./healthcheck /chainquery /start /usr/bin/
HEALTHCHECK --interval=1m --timeout=30s \
CMD healthcheck
EXPOSE 6300
USER chainquery
STOPSIGNAL SIGINT

View file

@ -1,3 +1,2 @@
#!/usr/bin/env bash
## TODO: Implement this at some point it requires CURL in the container.
curl http://localhost:6300/api/status
curl --fail http://localhost:6300/api/status || exit 1