summaryrefslogtreecommitdiff
path: root/dockerfiles
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2020-08-18 17:14:06 +0000
committerGitHub <noreply@github.com>2020-08-18 19:14:06 +0200
commit9b9b5e962520b2122cccb32858cce6fc8e0a0130 (patch)
tree5cc3f7ffd70b5a7072acf2d5518606c2aa05a59b /dockerfiles
parenta5e6423c3926a6c9811f11cd3e2b10fa1bbde012 (diff)
[fix] docker-entrypoint.sh -h hangs if searx is a valid user (#2099)
Implement a more robust detection if a process runs inside or outside of a docker image. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'dockerfiles')
-rwxr-xr-xdockerfiles/docker-entrypoint.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/dockerfiles/docker-entrypoint.sh b/dockerfiles/docker-entrypoint.sh
index 221a204a..2ea2f051 100755
--- a/dockerfiles/docker-entrypoint.sh
+++ b/dockerfiles/docker-entrypoint.sh
@@ -15,21 +15,21 @@ help() {
printf " BIND_ADDRESS uwsgi bind to the specified TCP socket using HTTP protocol. Default value: \"${DEFAULT_BIND_ADDRESS}\"\n"
printf "\nVolume:\n\n"
printf " /etc/searx the docker entry point copies settings.yml and uwsgi.ini in this directory (see the -f command line option)\n"
+ echo
exit 0
}
+if ! grep docker /proc/1/cgroup -qa; then
+ help
+fi
+
export DEFAULT_BIND_ADDRESS="0.0.0.0:8080"
if [ -z "${BIND_ADDRESS}" ]; then
export BIND_ADDRESS="${DEFAULT_BIND_ADDRESS}"
fi
export SEARX_VERSION=$(su searx -c 'python3 -c "import six; import searx.version; six.print_(searx.version.VERSION_STRING)"' 2>/dev/null)
-if [ -z "${SEARX_VERSION}" ]; then
- # outside docker, display help
- help
-else
- printf 'searx version %s\n\n' "${SEARX_VERSION}"
-fi
+printf 'searx version %s\n\n' "${SEARX_VERSION}"
export UWSGI_SETTINGS_PATH=/etc/searx/uwsgi.ini
export SEARX_SETTINGS_PATH=/etc/searx/settings.yml