Fixed healthcheck for classic (non Kubernetes) Docker (broken with default-ipv6 "::" listen ip) #89

Added multi-ip healthcheck support
Cleanup of logging inside container-scripts
Removed "nc" from containers
This commit is contained in:
simonmicro 2023-05-06 17:55:58 +02:00
parent 92ec80b698
commit 474c5feb6d
No known key found for this signature in database
GPG key ID: 033A4D4CE4E063D6
5 changed files with 79 additions and 47 deletions

View file

@ -27,7 +27,6 @@ RUN apk add --no-cache --update \
ca-certificates \
tzdata \
shadow \
netcat-openbsd \
&& pip3 install --no-cache-dir -r /home/py-kms/requirements.txt \
#&& apk del git build-base python3-dev \
&& mkdir /db/ \
@ -38,19 +37,19 @@ RUN apk add --no-cache --update \
COPY py-kms /home/py-kms/
COPY docker/entrypoint.py /usr/bin/entrypoint.py
COPY docker/healthcheck.py /usr/bin/healthcheck.py
COPY docker/start.py /usr/bin/start.py
RUN chmod 555 /usr/bin/entrypoint.py /usr/bin/healthcheck.py /usr/bin/start.py
# Web-interface specifics
COPY LICENSE /LICENSE
RUN echo "$BUILD_COMMIT" > /VERSION && echo "$BUILD_BRANCH" >> /VERSION
RUN chmod 755 /usr/bin/entrypoint.py
WORKDIR /home/py-kms
EXPOSE ${PORT}/tcp
EXPOSE 8080/tcp
HEALTHCHECK --interval=5m --timeout=3s --start-period=10s --retries=4 CMD echo | nc -z ${IP%% *} ${PORT} || exit 1
HEALTHCHECK --interval=5m --timeout=10s --start-period=10s --retries=3 CMD /usr/bin/python3 /usr/bin/healthcheck.py
ENTRYPOINT [ "/usr/bin/python3", "-u", "/usr/bin/entrypoint.py" ]