diff --git a/docker/Dockerfile b/docker/Dockerfile index da1d37c..2f13dc3 100755 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,11 +19,14 @@ RUN \ COPY rootfs / COPY --from=builder /src/target/release/hbbr /usr/bin/hbbr COPY --from=builder /src/target/release/hbbs /usr/bin/hbbs +COPY healthcheck.sh /usr/bin/healthcheck.sh ENV RELAY relay.example.com EXPOSE 21115 21116 21116/udp 21117 21118 21119 +HEALTHCHECK --interval=10s --timeout=5s CMD /usr/bin/healthcheck.sh + WORKDIR /data VOLUME /data diff --git a/docker/healthcheck.sh b/docker/healthcheck.sh new file mode 100755 index 0000000..f7ae0d7 --- /dev/null +++ b/docker/healthcheck.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +/package/admin/s6/command/s6-svstat /run/s6-rc/servicedirs/hbbr || exit 1 +/package/admin/s6/command/s6-svstat /run/s6-rc/servicedirs/hbbs || exit 1