Files
HomeDash/supervisord.conf
JianFeeeee aa237868c1 feat(deploy): let data volume override SearXNG settings
SearXNG 的配置原本只能靠镜像内置的 /etc/searxng/settings.yml,
于是代理(outgoing.proxies)这类部署相关配置每次重建容器都会丢,
改配置也必须重建镜像。

改为:容器启动时若存在 /app/data/searxng-settings.yml 就用它,
否则回退到镜像内置配置。用 sh -c 包一层是因为 supervisord 的
environment= 不支持条件判断。

注意必须带 [ -f ] 判断:实测 SEARXNG_SETTINGS_PATH 指向不存在的
文件时 SearXNG 会直接报错退出(PermissionError: ... not exists!)。

已验证:SEARXNG_SETTINGS_PATH 指向自造配置能正确覆盖端口与实例名。
README 补充配置优先级与数据卷备份清单。
2026-09-11 11:09:33 +08:00

50 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile=/run/supervisord.pid
childlogdir=/var/log/supervisor
[program:nginx]
command=nginx -g "daemon off;"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:searxng]
# 配置优先级:data 卷里的 /app/data/searxng-settings.yml 存在则用它,
# 否则用镜像内置的 /etc/searxng/settings.yml。
#
# 这样代理(outgoing.proxies)这类**部署相关**配置就落在数据卷里,
# 重建容器不会再丢;同时也免去“改配置必须重建镜像”。
# 注意:不能用 supervisord 的 environment= 做条件判断,它不支持逻辑,
# 所以这里用 sh -c 包一层(/bin/sh 是 dash,语法保持最小)。
command=/bin/sh -c 'if [ -f /app/data/searxng-settings.yml ]; then export SEARXNG_SETTINGS_PATH=/app/data/searxng-settings.yml; fi; exec /app/searxng-venv/bin/python -m searx.webapp'
# 不设 environment:继承 docker run -e SEARXNG_BASE_URL 等父进程环境变量
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:history-server]
command=/usr/local/bin/history-server
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:admin-server]
command=/usr/local/bin/admin-server
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0