From 5d4cd64b309c715b32c0e31f4f1f46d533165cf1 Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Wed, 9 Sep 2026 10:22:10 +0800 Subject: [PATCH] fix: restore working Dockerfile (SearXNG pip install + msgspec + --no-build-isolation) --- Dockerfile | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index fbff0d8..b96e6a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,13 +12,14 @@ 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 +ARG HTTP_PROXY=http://172.17.0.1:7890 +ARG HTTPS_PROXY=http://172.17.0.1:7890 + ENV DEBIAN_FRONTEND=noninteractive +ENV http_proxy=${HTTP_PROXY} +ENV https_proxy=${HTTPS_PROXY} ENV HTTP_PROXY=${HTTP_PROXY} ENV HTTPS_PROXY=${HTTPS_PROXY} @@ -26,16 +27,13 @@ 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" +RUN git clone --depth 1 https://github.com/searxng/searxng.git /src/searxng \ + && python3 -m venv /opt/searxng-venv \ + && /opt/searxng-venv/bin/pip install --upgrade pip setuptools wheel msgspec \ + && cd /src/searxng \ + && /opt/searxng-venv/bin/pip install --no-cache-dir -r requirements.txt \ + && /opt/searxng-venv/bin/pip install --no-cache-dir --no-build-isolation . \ + && rm -rf /src/searxng # ── Stage 3: Runtime ── FROM debian:bookworm-slim