Skip to content

Commit

Permalink
Add HEALTHCHECK to Dockerfiles
Browse files Browse the repository at this point in the history
Check for open gearmand port. Healthcheck will fail if gearmand is not
listening.
  • Loading branch information
sbreker committed Apr 25, 2024
1 parent 65cf449 commit de1c047
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 1.1.21.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ RUN apk add --no-cache --virtual .build-deps \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

HEALTHCHECK --interval=5m --timeout=3s --retries=2 \
CMD test $(netstat -ltn | grep -c :$GEARMAND_LISTEN_PORT) -eq 1 || exit 1

COPY docker-entrypoint.sh /usr/local/bin/
RUN apk add --no-cache bash=5.2.21-r0 \
&& touch /etc/gearmand.conf && chown gearman:gearman /etc/gearmand.conf \
Expand Down

0 comments on commit de1c047

Please sign in to comment.