From 82c8e73a9082f30a552e7cd7b7766924f2a74c8c Mon Sep 17 00:00:00 2001 From: zstadler Date: Thu, 16 Mar 2023 11:45:13 +0200 Subject: [PATCH] Launch Xvfb only if needed Resolve #794 --- docker-entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7c0b1e3..ba08bd2 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -2,7 +2,8 @@ if ! which -- "${1}"; then # first arg is not an executable export DISPLAY=:99 - Xvfb "${DISPLAY}" -nolisten unix & + # Launch Xvfb if needed + xdpyinfo --display "${DISPLAY}" >/dev/null 2>&1 || Xvfb "${DISPLAY}" -nolisten unix & exec node /usr/src/app/ "$@" fi