Skip to content

Commit

Permalink
Add healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Oct 20, 2023
1 parent b2b115e commit 5689589
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:labs
# syntax=docker/dockerfile:1.6

# 0. Prepare images
ARG PYTHON_VERSION="3.11"
Expand Down Expand Up @@ -61,3 +61,6 @@ VOLUME /config
WORKDIR /config

CMD ["go2rtc", "-config", "/config/go2rtc.yaml"]

HEALTHCHECK --start-period=10s --start-interval=2s --interval=30s --timeout=10s --retries=3 \
CMD curl --fail --silent --show-error --output /dev/null http://127.0.0.1:1984/api || exit 1
15 changes: 9 additions & 6 deletions hardware.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:labs
# syntax=docker/dockerfile:1.6

# 0. Prepare images
# only debian 12 (bookworm) has latest ffmpeg
Expand Down Expand Up @@ -46,11 +46,11 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean \
# non-free for Intel QSV support (not used by go2rtc, just for tests)
# libasound2-plugins for ALSA support
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked --mount=type=cache,target=/var/lib/apt,sharing=locked \
echo 'deb http://deb.debian.org/debian bookworm non-free' > /etc/apt/sources.list.d/debian-non-free.list && \
apt-get -y update && apt-get -y install tini ffmpeg \
python3 curl jq \
intel-media-va-driver-non-free \
libasound2-plugins
echo 'deb http://deb.debian.org/debian bookworm non-free' > /etc/apt/sources.list.d/debian-non-free.list && \
apt-get -y update && apt-get -y install tini ffmpeg \
python3 curl jq \
intel-media-va-driver-non-free \
libasound2-plugins

COPY --link --from=rootfs / /

Expand All @@ -64,3 +64,6 @@ ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,video,utility

CMD ["go2rtc", "-config", "/config/go2rtc.yaml"]

HEALTHCHECK --start-period=10s --start-interval=2s --interval=30s --timeout=10s --retries=3 \
CMD curl --fail --silent --show-error --output /dev/null http://127.0.0.1:1984/api/ || exit 1

0 comments on commit 5689589

Please sign in to comment.