Adding and enabling HEALTHCHECK

This commit is contained in:
Leopere authored and Leopere committed 2019-04-30 10:51:53 -04:00
1 parent 409586c45e
commit 77ee9dc39d
2 files changed
+5 -3

No files matched your search

@@ -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
+1 -2
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