Skip to content

Commit ed0ef0c

Browse files
authored
ENH: Checks DFSL in healthcheck (#30)
1 parent 4c17aa4 commit ed0ef0c

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ EXPOSE 8080
4545
RUN apk --no-cache add tini
4646
ENTRYPOINT ["/sbin/tini", "-g", "--"]
4747
CMD ["docker-flow-proxy", "server"]
48-
HEALTHCHECK --interval=5s --start-period=3s --timeout=5s CMD check.sh
48+
HEALTHCHECK --interval=5s --start-period=3s --timeout=10s CMD check.sh
4949

5050
COPY scripts/check.sh /usr/local/bin/check.sh
5151
RUN chmod +x /usr/local/bin/check.sh

scripts/check.sh

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1-
if [[ "$HEALTHCHECK" = "true" ]] ; then
1+
if [[ "$HEALTHCHECK" == "true" ]]; then
22

33
wget -qO- "http://localhost:8080/v1/docker-flow-proxy/ping"
44

5-
if [[ $? -ne 0 ]] ; then
5+
if [[ $? -ne 0 ]]; then
66
echo "ERROR: Failed to ping docker-flow-proxy"
77
exit 1
88
fi
99

1010
pgrep -x "haproxy"
1111

12-
if [[ $? -ne 0 ]] ; then
12+
if [[ $? -ne 0 ]]; then
1313
echo "ERROR: haproxy process is not running"
1414
exit 1
1515
fi
1616

17+
if [[ "$LISTENER_ADDRESS" != "" ]]; then
18+
wget -qO- "http://${LISTENER_ADDRESS}:8080/v1/docker-flow-swarm-listener/ping"
19+
20+
if [[ $? -ne 0 ]]; then
21+
echo "ERROR: Unable to ping ${LISTENER_ADDRESS}"
22+
exit 1
23+
fi
24+
25+
wget -qO- "http://localhost:8080/v1/docker-flow-proxy/reload"
26+
27+
if [[ $? -ne 0 ]]; then
28+
echo "ERROR: Unable to reload docker flow proxy"
29+
exit 1
30+
fi
31+
fi
32+
1733
fi
1834

1935
exit 0

0 commit comments

Comments
 (0)