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 23, 2024
1 parent d4a731f commit d05f078
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 1.1.15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ RUN set -x \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

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

COPY gearmand.conf /etc/gearmand.conf

COPY docker-entrypoint.sh /usr/local/bin/
Expand Down
3 changes: 3 additions & 0 deletions 1.1.16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ RUN set -x \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

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

COPY gearmand.conf /etc/gearmand.conf

COPY docker-entrypoint.sh /usr/local/bin/
Expand Down
3 changes: 3 additions & 0 deletions 1.1.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ RUN set -x \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

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

COPY gearmand.conf /etc/gearmand.conf

COPY docker-entrypoint.sh /usr/local/bin/
Expand Down
3 changes: 3 additions & 0 deletions 1.1.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ RUN set -x \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

HEALTHCHECK --interval=30s --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 \
&& touch /etc/gearmand.conf && chown gearman:gearman /etc/gearmand.conf \
Expand Down
3 changes: 3 additions & 0 deletions 1.1.19.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ RUN set -x \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

HEALTHCHECK --interval=30s --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 \
&& touch /etc/gearmand.conf && chown gearman:gearman /etc/gearmand.conf \
Expand Down
3 changes: 3 additions & 0 deletions 1.1.20.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ RUN set -x \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

HEALTHCHECK --interval=30s --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 \
&& touch /etc/gearmand.conf && chown gearman:gearman /etc/gearmand.conf \
Expand Down
3 changes: 3 additions & 0 deletions 1.1.21.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ RUN set -x \
&& apk del .build-deps \
&& /usr/local/sbin/gearmand --version

HEALTHCHECK --interval=30s --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 \
&& touch /etc/gearmand.conf && chown gearman:gearman /etc/gearmand.conf \
Expand Down

0 comments on commit d05f078

Please sign in to comment.