diff --git a/optional/clamav/Dockerfile b/optional/clamav/Dockerfile index fd5de38b..3a9bf4aa 100644 --- a/optional/clamav/Dockerfile +++ b/optional/clamav/Dockerfile @@ -4,10 +4,11 @@ RUN apk add --no-cache clamav rsyslog wget clamav-libunrar COPY conf /etc/clamav COPY start.sh /start.sh +COPY health.sh /health.sh EXPOSE 3310/tcp VOLUME ["/data"] CMD ["/start.sh"] -HEALTHCHECK CMD [ "$(echo PING | nc localhost 3310)" = "PONG" ] +HEALTHCHECK CMD /health.sh diff --git a/optional/clamav/health.sh b/optional/clamav/health.sh new file mode 100755 index 00000000..c4c55044 --- /dev/null +++ b/optional/clamav/health.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$(echo PING | nc localhost 3310)" = "PONG" ]; then + echo "ping successful" +else + echo "ping failed" + exit 1 +fi