mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
fix: healthcheck for docker containers (#2853)
* fix: healthcheck for docker containers Fixes #2841 --------- Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
1e135624d2
commit
9a6160039a
1 changed files with 3 additions and 1 deletions
|
@ -4,7 +4,9 @@ HOST="localhost"
|
|||
PORT=$HEALTHCHECK_PORT
|
||||
|
||||
if [ -z "$HEALTHCHECK_PORT" ]; then
|
||||
PORT=$(netstat -tuln | grep -oE ':[0-9]+' | grep -oE '[0-9]+' | tail -n 1)
|
||||
# check all the TCP listening sockets, filter the dragonfly process, and fetch the port.
|
||||
# For cases when dragonfly opens multiple ports, we filter with tail to choose one of them.
|
||||
PORT=$(netstat -tlnp | grep "1/dragonfly" | grep -oE ':[0-9]+' | cut -c2- | tail -n 1)
|
||||
fi
|
||||
|
||||
# If we're running with TLS enabled, utilise OpenSSL for the check
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue