feat(searxng-container): bind mount & add limiter

This commit is contained in:
ItzCrazyKns 2024-05-10 20:55:08 +05:30
parent baef45b456
commit 7eace1e6bd
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
5 changed files with 56 additions and 6 deletions

View File

@ -1,10 +1,10 @@
services:
searxng:
build:
context: .
dockerfile: searxng.dockerfile
image: docker.io/searxng/searxng:latest
ports:
- 4000:8080
volumes:
- ./searxng:/etc/searxng:rw
networks:
- perplexica-network

View File

@ -1,3 +0,0 @@
FROM searxng/searxng
COPY searxng-settings.yml /etc/searxng/settings.yml

3
searxng/limiter.toml Normal file
View File

@ -0,0 +1,3 @@
[botdetection.ip_limit]
# activate link_token method in the ip_limit method
link_token = true

50
searxng/uwsgi.ini Normal file
View File

@ -0,0 +1,50 @@
[uwsgi]
# Who will run the code
uid = searxng
gid = searxng
# Number of workers (usually CPU count)
# default value: %k (= number of CPU core, see Dockerfile)
workers = %k
# Number of threads per worker
# default value: 4 (see Dockerfile)
threads = 4
# The right granted on the created socket
chmod-socket = 666
# Plugin to use and interpreter config
single-interpreter = true
master = true
plugin = python3
lazy-apps = true
enable-threads = 4
# Module to import
module = searx.webapp
# Virtualenv and python path
pythonpath = /usr/local/searxng/
chdir = /usr/local/searxng/searx/
# automatically set processes name to something meaningful
auto-procname = true
# Disable request logging for privacy
disable-logging = true
log-5xx = true
# Set the max size of a request (request-body excluded)
buffer-size = 8192
# No keep alive
# See https://github.com/searx/searx-docker/issues/24
add-header = Connection: close
# uwsgi serves the static files
static-map = /static=/usr/local/searxng/searx/static
# expires set to one day
static-expires = /* 86400
static-gzip-all = True
offload-threads = 4