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

@ -22,7 +22,6 @@ bash \
ca-certificates \
shadow \
tzdata \
netcat-openbsd \
&& pip3 install --no-cache-dir -r /home/py-kms/requirements.txt \
&& adduser -S py-kms -G users -s /bin/bash \
&& chown py-kms:users /home/py-kms \
@ -31,14 +30,14 @@ bash \
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 755 /usr/bin/entrypoint.py
RUN chmod 555 /usr/bin/entrypoint.py /usr/bin/healthcheck.py /usr/bin/start.py
WORKDIR /home/py-kms
EXPOSE ${PORT}/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"]