Add docker healthcheck (#8006)

* Add docker healthcheck

* Fix unknown start-interval

* Add HEALTHCHECK for tensorrt and bump default start-period

* Move healthcheck to deps stage
This commit is contained in:
Felipe Santos 2023-10-07 11:21:03 -03:00 committed by GitHub
parent 67a5a7d21a
commit 3a460133d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.4 # syntax=docker/dockerfile:1.6
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable # https://askubuntu.com/questions/972516/debian-frontend-environment-variable
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
@ -199,6 +199,9 @@ ENV S6_LOGGING_SCRIPT="T 1 n0 s10000000 T"
ENTRYPOINT ["/init"] ENTRYPOINT ["/init"]
CMD [] CMD []
HEALTHCHECK --start-period=120s --start-interval=5s --interval=15s --timeout=5s --retries=3 \
CMD curl --fail --silent --show-error http://127.0.0.1:5000/api/version || exit 1
# Frigate deps with Node.js and NPM for devcontainer # Frigate deps with Node.js and NPM for devcontainer
FROM deps AS devcontainer FROM deps AS devcontainer

View File

@ -24,3 +24,6 @@ COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_laye
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
COPY docker/tensorrt/detector/rootfs/ / COPY docker/tensorrt/detector/rootfs/ /
ENV YOLO_MODELS="yolov7-320" ENV YOLO_MODELS="yolov7-320"
HEALTHCHECK --start-period=600s --start-interval=5s --interval=15s --timeout=5s --retries=3 \
CMD curl --fail --silent --show-error http://127.0.0.1:5000/api/version || exit 1