Need help with SearXNG in docker - cp: can't create '/etc/searxng/uwsgi.ini': Permission denied
Hey guys what's up, first post on Lemmy here.
I tried to get a SearXNG instance to run on my home server but cannot seem to get it to work.
.env
# By default listen on https://localhost
# To change this:
# * uncomment SEARXNG_HOSTNAME, and replace by the SearXNG hostname
# * uncomment LETSENCRYPT_EMAIL, and replace by your email (require to create a Let's Encrypt certificate)
SEARXNG_HOSTNAME=search.xxxxx.com
# LETSENCRYPT_EMAIL=
# see https://docs.searxng.org/admin/engines/settings.html#use-default-settings
use_default_settings: true
server:
# base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.yml
secret_key: "THE_SECRET_KEY" # change this!
limiter: true # can be disabled for a private instance
image_proxy: true
ui:
static_use_hash: true
redis:
url: redis://redis:6379/0
I commented out the caddy stuff in the docker-compose.yml as I have an extra instance of caddy that handles all the reverse proxy and cert stuff.
Even if I run this with caddy not commented out I get the same errors.
Logs
SearXNG version 2023.8.8+b8352eca0
Create /etc/searxng/uwsgi.ini
cp: can't create '/etc/searxng/uwsgi.ini': Permission denied
sed: /etc/searxng/uwsgi.ini: No such file or directory
Use existing /etc/searxng/settings.yml
Listen on 0.0.0.0:8080
realpath() of /etc/searxng/uwsgi.ini failed: No such file or directory [core/utils.c line 3662]
SearXNG version 2023.8.8+b8352eca0
Create /etc/searxng/uwsgi.ini
cp: can't create '/etc/searxng/uwsgi.ini': Permission denied
sed: /etc/searxng/uwsgi.ini: No such file or directory
Use existing /etc/searxng/settings.yml
Listen on 0.0.0.0:8080
realpath() of /etc/searxng/uwsgi.ini failed: No such file or directory [core/utils.c line 3662]
SearXNG version 2023.8.8+b8352eca0
Any help is appreciated. This doesn't seem to be a common error out there as there is not much info on the web.
OP - this is the correct (first) thing to check. Looks like the bind mount for ./searxng isn't working as expected, inside the running container. It may have created an empty file of the same name there instead.
The permissions are not set right with the cap drop abilities. Comment out cap drop lines fir the first start. The files are created now. Then you can undo outcommenting and restart again