Adding and enabling HEALTHCHECK
This commit is contained in:
parent
409586c45e
commit
77ee9dc39d
2 changed files with 5 additions and 3 deletions
|
@ -9,6 +9,7 @@ RUN apt-get update && \
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
COPY ./stuff/start.sh start
|
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) && \
|
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 && \
|
unzip /chainquery.zip && \
|
||||||
rm /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
|
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 && \
|
RUN adduser chainquery --gecos GECOS --shell /bin/bash --disabled-password --home /home/chainquery && \
|
||||||
chown -R chainquery:chainquery /etc/lbry
|
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
|
EXPOSE 6300
|
||||||
USER chainquery
|
USER chainquery
|
||||||
STOPSIGNAL SIGINT
|
STOPSIGNAL SIGINT
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
## TODO: Implement this at some point it requires CURL in the container.
|
curl --fail http://localhost:6300/api/status || exit 1
|
||||||
curl http://localhost:6300/api/status
|
|
||||||
|
|
Loading…
Reference in a new issue