Skip to content

Commit

Permalink
Merge pull request #3188 from nextcloud/enh/noid/improve-talk-healthc…
Browse files Browse the repository at this point in the history
…heck

talk - improve healthcheck
  • Loading branch information
szaimen authored Aug 21, 2023
2 parents 9200cb3 + e6af640 commit ede981f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Containers/talk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ COPY --from=nats /nats-server /usr/local/bin/nats-se
COPY --from=signaling /usr/bin/nextcloud-spreed-signaling /usr/local/bin/nextcloud-spreed-signaling

COPY --chmod=775 start.sh /start.sh
COPY --chmod=775 healthcheck.sh /healthcheck.sh
COPY --chmod=664 supervisord.conf /supervisord.conf

RUN set -ex; \
Expand Down Expand Up @@ -102,5 +103,5 @@ USER eturnal
ENTRYPOINT ["/start.sh"]
CMD ["supervisord", "-c", "/supervisord.conf"]

HEALTHCHECK CMD (nc -z localhost 8081 && nc -z localhost 8188 && nc -z localhost 4222 && nc -z localhost "$TALK_PORT" && nc -z "$NC_DOMAIN" "$TALK_PORT" && eturnalctl status) || exit 1
HEALTHCHECK CMD /healthcheck.sh
LABEL com.centurylinklabs.watchtower.enable="false"
11 changes: 11 additions & 0 deletions Containers/talk/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

nc -z localhost 8081 || exit 1
nc -z localhost 8188 || exit 1
nc -z localhost 4222 || exit 1
nc -z localhost "$TALK_PORT" || exit 1
eturnalctl status || exit 1
if ! nc -z "$NC_DOMAIN" "$TALK_PORT"; then
echo "Could not reach $NC_DOMAIN on port $TALK_PORT."
exit 1
fi

0 comments on commit ede981f

Please sign in to comment.