on master help sign in
[enh] update documentation about docker
commit4a35975b427b3ebee4f5cc54e2390356b0102536 authorDalf <alex@al-f.net> dateWed 22 Jul 2020, 14:58 (6 years ago) parent7ef62c6
3 files changed+77−26
.dockerignore+8−1 dockerfiles/docker-entrypoint.sh+31−19 docs/admin/installation-docker.rst+38−6
.dockerignore+8−1
@@ -46,4 +46,11 @@ node_modules/
4646*/*/*/node_modules/
4747*/*/*/*/node_modules/
4848
49−.tx/
49+.tx/
50+
51+#
52+build/
53+dist/
54+local/
55+gh-pages/
56+searx.egg-info/
dockerfiles/docker-entrypoint.sh+31−19
@@ -1,15 +1,39 @@
11#!/bin/sh
22
3−export SEARX_VERSION=$(su searx -c 'python3 -c "import six; import searx.version; six.print_(searx.version.VERSION_STRING)"')
4−printf 'searx version %s\n\n' "${SEARX_VERSION}"
5−
6−export UWSGI_SETTINGS_PATH=/etc/searx/uwsgi.ini
7−export SEARX_SETTINGS_PATH=/etc/searx/settings.yml
3+help() {
4+ printf "Command line:\n\n"
5+ printf " -h Display this help\n"
6+ printf " -d Dry run to update the configuration files.\n"
7+ printf " -f Always update on the configuration files (existing files are renamed with the .old suffix)\n"
8+ printf " Without this option, the new configuration files are copied with the .new suffix\n"
9+ printf "\nEnvironment variables:\n\n"
10+ printf " INSTANCE_NAME settings.yml : general.instance_name\n"
11+ printf " AUTOCOMPLETE settings.yml : search.autocomplete\n"
12+ printf " BASE_URL settings.yml : server.base_url\n"
13+ printf " MORTY_URL settings.yml : result_proxy.url\n"
14+ printf " MORTY_KEY settings.yml : result_proxy.key\n"
15+ printf " BIND_ADDRESS uwsgi bind to the specified TCP socket using HTTP protocol. Default value: \"${DEFAULT_BIND_ADDRESS}\"\n"
16+ printf "\nVolume:\n\n"
17+ printf " /etc/searx the docker entry point copies settings.yml and uwsgi.ini in this directory (see the -f command line option)\n"
18+ exit 0
19+}
820
21+export DEFAULT_BIND_ADDRESS="0.0.0.0:8080"
922if [ -z "${BIND_ADDRESS}" ]; then
10− export BIND_ADDRESS=":8080"
23+ export BIND_ADDRESS="${DEFAULT_BIND_ADDRESS}"
1124fi
1225
26+export SEARX_VERSION=$(su searx -c 'python3 -c "import six; import searx.version; six.print_(searx.version.VERSION_STRING)"' 2>/dev/null)
27+if [ -z "${SEARX_VERSION}" ]; then
28+ # outside docker, display help
29+ help
30+else
31+ printf 'searx version %s\n\n' "${SEARX_VERSION}"
32+fi
33+
34+export UWSGI_SETTINGS_PATH=/etc/searx/uwsgi.ini
35+export SEARX_SETTINGS_PATH=/etc/searx/settings.yml
36+
1337# Parse command line
1438FORCE_CONF_UPDATE=0
1539DRY_RUN=0
@@ -23,19 +47,7 @@ do
2347 DRY_RUN=1
2448 ;;
2549 h)
26− printf "Command line:\n\n"
27− printf " -h Display this help\n"
28− printf " -d Dry run to update the configuration files.\n"
29− printf " -f Always update on the configuration files (existing files are renamed with the .old suffix)\n"
30− printf " Without this option, new configuration files are copied with the .new suffix\n"
31− printf "\nEnvironment variables:\n\n"
32− printf " INSTANCE_NAME settings.yml : general.instance_name\n"
33− printf " AUTOCOMPLETE settings.yml : search.autocomplete\n"
34− printf " BASE_URL settings.yml : server.base_url\n"
35− printf " MORTY_URL settings.yml : result_proxy.url\n"
36− printf " MORTY_KEY settings.yml : result_proxy.key\n"
37− printf " BIND_ADDRESS where uwsgi will accept HTTP request (format : host:port)\n"
38− exit 0
50+ help
3951 esac
4052done
4153
docs/admin/installation-docker.rst+38−6
@@ -9,20 +9,52 @@ Docker installation
99 :local:
1010 :backlinks: entry
1111
12−Make sure you have installed Docker. For instance, you can deploy searx like this:
12+----
13+
14+Docker image searx/searx
15+========================
16+
17+
18+The docker image is `searx/searx <https://hub.docker.com/r/searx/searx>`_ (based on `github.com/searx/searx <https://github.com/searx/searx>`_).
19+
20+Make sure you have `installed Docker <https://docs.docker.com/get-docker/>`_. For instance, you can deploy a local instance:
1321
1422.. code:: sh
1523
16− docker pull wonderfall/searx
17− docker run -d --name searx -p $PORT:8888 wonderfall/searx
24+ export PORT=80
25+ docker pull searx/searx
26+ docker run --rm -d -v ${PWD}/searx:/etc/searx -p $PORT:8080 -e BASE_URL=http://localhost:$PORT/ searx/searx
1827
1928Go to ``http://localhost:$PORT``.
2029
21−See https://hub.docker.com/r/wonderfall/searx/ for more informations. It's also
22−possible to build searx from the embedded Dockerfile.
30+Inside ``${PWD}/searx``, you will find ``settings.yml`` and ``uwsgi.ini``.
31+You can modify these files according to your needs and restart the Docker image.
32+
33+
34+Command line
35+------------
36+
37+
38+.. code:: sh
39+
40+ docker run --rm -it searx/searx -h
41+
42+.. program-output:: ../dockerfiles/docker-entrypoint.sh -h
43+
44+
45+Build the image
46+---------------
47+
48+It's also possible to build searx from the embedded Dockerfile.
2349
2450.. code:: sh
2551
2652 git clone https://github.com/asciimoo/searx.git
2753 cd searx
28− docker build -t whatever/searx .
54+ make docker
55+
56+
57+Public instance
58+===============
59+
60+If you intend to create a public instance using Docker, see https://github.com/searx/searx-docker