Commit graph

72 commits

Author SHA1 Message Date
Markus Heiser
f63f97c56c Revert "Fix for broken docker builds"
This reverts commit 4ef1c706f8.
2024-10-29 13:50:38 +01:00
Markus Heiser
163031c394 Revert "[fix] typo in Dockerfile"
This reverts commit 038a2ff6bd.
2024-10-29 13:50:38 +01:00
Markus Heiser
038a2ff6bd [fix] typo in Dockerfile
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-10-17 19:57:33 +02:00
rhee876527
4ef1c706f8 Fix for broken docker builds
Add temporary fix to broken docker builds in anticipation of yet to be released pydantic version v2.24.1
2024-10-17 19:14:33 +02:00
Markus Heiser
f1f0dfd231 Revert "[fix] docker: alpine - install apk py3-pydantic-core"
This reverts commit 5332d3a0b8.
2024-10-07 13:18:54 +02:00
Markus Heiser
5332d3a0b8 [fix] docker: alpine - install apk py3-pydantic-core
Alpine Linux uses musl libc (instead of glibc). However, there is no pre-build
of the pydantic-core python package for musl lib on armv7.  Alternatively this
patch installs py3-pydantic-core from Alpine packages [1]

[1] https://pkgs.alpinelinux.org/package/edge/community/armv7/py3-pydantic-core

- closes: https://github.com/searxng/searxng/issues/3887

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-10-06 11:59:57 +02:00
Ivan Gabaldon
26b66dd3be [fix] everything is logged with "priority 3" on journal
Closes: https://github.com/searxng/searxng/issues/3649
2024-07-27 09:11:49 +02:00
Alexandre Flament
37d0438f25 Dockerfile: use Alpine 3.20 & Python 3.12 2024-07-14 16:38:30 +02:00
Alexandre Flament
b7be53bb90 Docker: use Alpine 3.19 2024-03-04 19:40:57 +01:00
Alexandre Flament
bd3f526859
Docker: add UWSGI_WORKERS and UWSGI_THREAD environment variables (#2992)
* Docker: add UWSGI_WORKERS and UWSGI_THREAD.

UWSGI_WORKERS specifies the number of process.
UWSGI_THREADS specifies the number of threads.

The Docker convention is to specify the whole configuration
through environment variables. While not done in SearXNG, these two
additional variables allows admins to skip uwsgi.ini

In additional, https://github.com/searxng/preview-environments starts Docker
without additional files through searxng-helm-chat.
Each instance consumes 1Go of RAM which is a lot especially when there are a
lot of instances / pull requests.

* [scripts] add environments UWSGI_WORKERS and UWSGI_THREADS

- UWSGI_WORKERS specifies the number of process.
- UWSGI_THREADS specifies the number of threads.

Templates for uwsgi scripts can be tested by::

    UWSGI_WORKERS=8 UWSGI_THREADS=9 \
      ./utils/searxng.sh --cmd\
      eval "echo \"$(cat utils/templates/etc/uwsgi/*/searxng.ini*)\""\
      | grep "workers\|threads"

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

---------

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2023-11-12 16:46:34 +00:00
Nico Berlee
fe0cce2ad9
Bump Alpine 3.18 (Python 3.11) 2023-05-10 10:36:15 +02:00
Alexandre Flament
f759a84af4 SearXNG version: fix make docker
continuation of #2117
related to #2111

This commit:
* fixes the Docker tag using an additional variable DOCKER_TAG, see searx/version.py
* fixes the Docker labels org.label-schema.vcs-ref and org.opencontainers.image.revision
* adds searx/version_frozen to .gitignore
2023-01-20 10:46:00 +00:00
Alexandre Flament
ec4237586d Use fasttext-predict instead of fasttext or fasttext-wheel
See https://github.com/searxng/fasttext-predict
2022-12-26 18:44:21 +00:00
Markus Heiser
ed901ab18e [mod] improve 'Autodetect search language' plugin
- Add documentation to the plugin
- Harmonize FastText language model with SearXNG's language model

Reosurces::

    import fasttext                                    # --> +10 MB
    fasttext.load_model(str(data_dir / 'lid.176.ftz')) # --> +4MB

Suggested-by: @dalf

- To speed up and simplify the deployment use fasttext-wheel instead of fasttext
- Building numpy on the Alpine Linux of docker-images takes ages --> install
  py3-numpy from Alpines package manager (apk)
- Alpine Linux on docker-images (musl libc) do not support fasttext-wheel (gnu
  libc) --> patch Dockerfile and build from fastetxt:

     sed -i s/fasttext-wheel/fasttext/ requirements.txt

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-12-11 11:26:07 +01:00
Markus Heiser
44d4a1714c
Merge pull request #1990 from ngosang/feature/alpine
Update base Docker image to Alpine 3.17
2022-11-30 10:32:34 +01:00
ngosang
ba61457220 Update base Docker image to Alpine 3.17
* Python version is unchanged 3.10.8
* This issue is fixed https://github.com/searxng/searxng-docker/issues/31
2022-11-29 23:45:10 +01:00
ngosang
6b88e857f9 fix 2022-11-29 23:31:49 +01:00
ngosang
9417c284d3 Reduce Docker image size
* Remove compiled sources. Most of them are never used. Those in use are compiled in the first run really fast.
* Copy only source code and Docker entypoint
* Image size reduced by 41 MB (195 MB -> 154 MB uncompressed)
2022-11-29 22:32:28 +01:00
LinuxMeow
67455274b6
Remove unused volime
Docker file used old project volume instruction which is not existent in current one. It used to create clutter in created volumes without names and purposes polluting the docker environment.

Volume doesn't point to existing directory inside container and has no actual use other then creating docker volume mess each time container is run recreated or potentially restarted.
2022-10-31 19:19:20 +01:00
Alexandre FLAMENT
95603e54e1 Dockerfile: use alpine 3.16 2022-06-27 17:44:30 +00:00
Alexandre Flament
12d3fe3214 docker: log to stdout
previously the log (only the exceptions) were log
into /var/log/uwsgi/uwsgi.log

this is disturbing for the admins:
* they see an internal error on HTTP port
* no log where they are expected (docker logs)

this commit fixes this issue
2022-03-19 13:47:45 +01:00
Alexandre Flament
4bd78a7ef0 [mod] Dockerfile: use binary from pypi
lxml doesn't raise any exception
2021-12-18 14:07:29 +01:00
Alexandre Flament
f9c9284f48
Dockerfile: use alpine 3.15
Use Python 3.9.7-r4 (previously 3.9.5-r2)
2021-12-11 17:06:23 +01:00
Alexandre Flament
dc39f9c960 [fix] Dockerfile image
ignore existing wheels, rebuild all of them
fix an issue the lxml wheel for the muslc
2021-11-05 20:05:26 +01:00
Alexandre Flament
9e03823b98 SearXNG: docker 2021-10-12 20:23:57 +02:00
Alexandre Flament
253b850376 SearXNG: SEARXNG_SETTINGS_PATH 2021-10-02 17:18:05 +02:00
Alexandre Flament
499c7b3cce SearXNG: .github, searxng-docker 2021-10-01 09:48:53 +02:00
Alexandre Flament
4b43775c91 version based on the git repository
This commit remove the need to update the brand for GIT_URL and GIT_BRANCH:
there are read from the git repository.

It is possible to call python -m searx.version freeze to freeze the current version.
Useful when the code is installed outside git (distro package, docker, etc...)
2021-07-30 14:40:09 +02:00
Alexandre Flament
ef12c41206
Docker: upgrade to alpine 3.14
Uses Python version 3.9 instead of 3.8
2021-06-21 18:03:54 +02:00
Markus Heiser
130e58f982 [brand] Dockerfile default INSTANCE_NAME=searxng
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17 12:02:24 +02:00
Alexandre Flament
8c5cb5039e [mod] Dockerfile: upgrade to Alpine 3.13
See:
* https://alpinelinux.org/posts/Alpine-3.13.0-released.html
* musl>=1.2.1 have a new malloc implementation (mallocng) :
2021-05-09 11:06:07 +02:00
Alexandre Flament
20580bcbd4 [docker] multiarch support: linux/amd64,linux/arm64,linux/arm/v7
make docker.buildx : build and push multiarch build.
(it can't be only build)

use buildx with the --cache-from and --cache-to options to cache the layers
(only the last built is cached)
2021-04-28 14:40:00 +02:00
3nprob
0fb423ea59 Allow overriding env vars SEARX_SETTINGS_PATH,UWSGI_SETTINGS_PATH 2021-04-08 12:56:15 +09:00
3nprob
3c6c827330 Reduce redundant docker build steps 2021-04-05 15:51:34 +09:00
Alexandre Flament
ae0b621ec8
[mod] Dockerfile: remove protobuff dependency
See https://github.com/searx/searx/pull/2481
2021-03-25 17:09:28 +01:00
Alexandre Flament
8cbc9f2d58 [enh] add checker 2021-01-12 11:47:17 +01:00
Alexandre Flament
4cc8644ec9
Merge pull request #1865 from dalf/uwsgi_static
[enh] Docker image: uwsgi serves the static files directly.
2020-09-19 16:04:07 +02:00
Wonderfall
7b19e6c5f4
Dockerfile: upgrade base to alpine 3.12 (#1983)
Author: Wonderfall <wonderfall@targaryen.house>
2020-07-11 12:07:51 +02:00
Jason Kaltsikis
5ed4d72cfa Remove cache of pip upgrade 2020-05-09 18:58:26 +03:00
Markus Heiser
0f4dbc4eca
Merge branch 'master' into uwsgi_static 2020-04-29 12:02:39 +00:00
Markus Heiser
3dbade0aed [fix] brands: add GIT_URL variable to the docker build
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-25 14:50:39 +01:00
Dalf
678d41d75b [enh] Docker image: uwsgi serves the static files directly.
When the image is built, the static files are compressed with gzip and brotli.
The expires header is set to one day (same as Flask)
There is not etag header (Flask does add an etag header)
2020-02-25 17:25:11 +01:00
mathieu.brunot
088752959e
📝 Opencontainers labels in docker image #1772
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2019-12-17 21:06:22 +01:00
Adam Tauber
1bb46e5e37
Merge pull request #1680 from robbyoconnor/patch-1
Add --no-cache to tell apk to not cache packages
2019-12-02 13:42:33 +00:00
mathieu.brunot
2485d41bdd
🐳 Config for instance name and autocomplete
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2019-10-14 02:02:41 +02:00
Robert O'Connor
86d1a4931f
.. 2019-08-18 18:29:02 -04:00
Robert O'Connor
dae5bcf253
some other minor tweaks to move stuff very unlikely to change to the top in efforts to delay cache invalidation 2019-08-18 18:26:40 -04:00
Robby O'Connor
906320d271
add --no-cache to package installs
Add --no-cache to apk upgrade and apk add calls.
2019-08-18 18:20:58 -04:00
Alexandre Flament
02bbbf59d6
[fix] Dockerfile: searx version stores in org.label-schema.version (#1659)
instead of org.label-schema.schema-version
2019-08-01 07:51:09 +02:00
Dalf
fbe40001d3 Update Docker image
See #1561 , use uwsgi and Alpine Linux

Volume:
/var/log/uwsgi contains error log for 2 days (file uwsgi.log)
/etc/searx contains the settings.yml and uwsgi.ini files.
The docker image creates them if they don't exist.
The two files can be modified after the first run. See below.

Environement variables:
MORTY_URL : external URL of Morty
MORTY_KEY : base64 encoded key
BASE_URL : external URL of Searx
BIND_ADDRESS : internal HTTP port to listen to

Labels : org.label-schema.schema.*

Parameters:
-h : display this help
-d : will update the settings and quit immediately (settings.yml and uwsgi.ini)
-f : always update the settings (previous version saved with suffix .old).
     without this parameter, the new settings are copied with suffix .new

When the Docker image contains newer settings:
- without -f parameter: the new versions are copied to /etc/searx/settings.yml.new and /etc/searx/uwsgi.ini.new.
- with -f parameter:  the old versions are renamed with .old suffix. The new version replaces /etc/searx/settings.yml and /etc/searx/uwsgi.ini

Build using "./manage.sh docker_build", add "push" as parameter also push the Docker image.
The script requires a git repository to work (it makes sure that the last git tag matches searx/version.py)
"git describe" is used to create a meaningful version.
Example : 0.15.0-90-49c5bcb4-dirty (dirty means that the docker image was made with uncommited changes).

Use "docker inspect -f {{.Config.Labels.version}} searx" to get the version of an existing image.

.dockerignore based on .gitignore

.travis.yml: include docker stage
2019-07-13 15:49:59 +02:00