- Single Docker container with nginx reverse proxy - SearXNG search proxy with configurable proxy support - Browser extensions (Chrome MV3 + Firefox MV2) with SSE-style history sync - Admin WebUI for managing navigation items - Full deployment tutorial including auth reverse proxy and webui4frpc tunnel - Sanitized conf.yml for public distribution - Fixed SearXNG search trailing-slash issue via nginx rewrite - Fixed SearXNG proxy configuration for China network access - Fixed SearXNG engine loading (removed broken keep_only, use default_settings)
81 lines
3.0 KiB
Docker
81 lines
3.0 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# ── Stage 1: Go binaries ──
|
|
FROM golang:1.21-bookworm AS gobuild
|
|
|
|
WORKDIR /src/history
|
|
COPY history-server/ .
|
|
RUN GOPROXY=https://goproxy.cn,direct CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/history-server .
|
|
|
|
WORKDIR /src/admin
|
|
COPY admin-server/ .
|
|
RUN GOPROXY=https://goproxy.cn,direct go mod tidy && CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/admin-server .
|
|
|
|
# ── Stage 2: SearXNG from source ──
|
|
# Build args for proxy (passed at build time)
|
|
ARG HTTP_PROXY=""
|
|
ARG HTTPS_PROXY=""
|
|
|
|
FROM debian:bookworm-slim AS searxng-build
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV HTTP_PROXY=${HTTP_PROXY}
|
|
ENV HTTPS_PROXY=${HTTPS_PROXY}
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3 python3-pip python3-venv git ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install SearXNG dependencies with proxy support
|
|
# Using --retries and longer timeout for reliability
|
|
RUN python3 -m venv /opt/searxng-venv && \
|
|
/opt/searxng-venv/bin/pip install --upgrade pip setuptools wheel && \
|
|
/opt/searxng-venv/bin/pip install --retries 5 --timeout 120 \
|
|
msgspec beautifulsoup4 lxml html5lib flask werkzeug gunicorn \
|
|
pyyaml python-dateutil flask-babel psutil pygments pymdown-extensions \
|
|
redis brotli brotli-ffi websocket-client httpx/setuptools && \
|
|
/opt/searxng-venv/bin/pip install --no-build-isolation \
|
|
"git+https://github.com/searxng/searxng.git@master"
|
|
|
|
# ── Stage 3: Runtime ──
|
|
FROM debian:bookworm-slim
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
nginx python3 supervisor curl ca-certificates git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy SearXNG venv + source
|
|
COPY --from=searxng-build /opt/searxng-venv /app/searxng-venv
|
|
COPY --from=searxng-build /usr/lib/python3.11 /usr/lib/python3.11
|
|
COPY --from=searxng-build /lib/x86_64-linux-gnu /lib/x86_64-linux-gnu
|
|
COPY --from=searxng-build /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
|
|
|
|
# Dashy static files
|
|
COPY --from=lissy93/dashy:latest /app/dist /app/dashy
|
|
|
|
# Go binaries
|
|
COPY --from=gobuild /out/history-server /usr/local/bin/history-server
|
|
COPY --from=gobuild /out/admin-server /usr/local/bin/admin-server
|
|
|
|
# Config files
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
COPY searxng-settings.yml /etc/searxng/settings.yml
|
|
COPY conf.example.yml /app/defaults/conf.yml
|
|
COPY admin/index.html /app/admin/index.html
|
|
|
|
# Inject search script into Dashy
|
|
COPY web/navi.js /app/dashy/navi.js
|
|
RUN sed -i 's#</body>#<script src="/navi.js"></script></body>#' /app/dashy/index.html
|
|
|
|
# Data directory
|
|
RUN mkdir -p /app/data/item-icons /var/log/supervisor /var/cache/searxng /run/nginx
|
|
|
|
VOLUME ["/app/data"]
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
|
CMD curl -fs http://localhost:8080/conf.yml || exit 1
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|