From 91336c73c2acc1084c10690e6b516ee3425d8c25 Mon Sep 17 00:00:00 2001 From: Joseph Cheung Date: Tue, 28 Feb 2023 22:55:11 +0800 Subject: [PATCH] o --- Dockerfile | 39 +++------------------------------------ requirements-dev.txt | 3 +++ requirements.txt | 3 +++ 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/Dockerfile b/Dockerfile index c8a3f41eb..ba113fc60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,5 @@ FROM python:3.11-slim-bullseye as builder -# Tiktoken requires Rust toolchain, so build it in a separate stage -RUN apt-get update && apt-get install -y gcc curl gfortran -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && apt-get install --reinstall libc6-dev -y -ENV PATH="/root/.cargo/bin:${PATH}" -RUN pip install --upgrade pip && pip install tiktoken scipy numpy - -FROM python:3.11-alpine ENTRYPOINT ["/sbin/tini","--","/usr/local/searxng/dockerfiles/docker-entrypoint.sh"] EXPOSE 8080 VOLUME /etc/searxng @@ -26,40 +19,14 @@ ENV INSTANCE_NAME=searxng \ GPTKEY= \ GPTORG= \ SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml \ - UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini + UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini \ + PATH="/root/.cargo/bin:${PATH}" WORKDIR /usr/local/searxng COPY requirements.txt ./requirements.txt -COPY --from=builder /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/ - -RUN apk add --no-cache -t build-dependencies \ - build-base \ - py3-setuptools \ - python3-dev \ - libffi-dev \ - libxslt-dev \ - libxml2-dev \ - openssl-dev \ - tar \ - git \ - && apk add --no-cache \ - ca-certificates \ - su-exec \ - python3 \ - py3-pip \ - libxml2 \ - libxslt \ - openssl \ - tini \ - uwsgi \ - uwsgi-python3 \ - brotli \ - py3-scipy \ - py3-numpy \ - && pip3 install --no-cache -r requirements.txt \ - && apk del build-dependencies \ +RUN apt-get update && apt-get install -y gcc curl && curl https://sh.rustup.rs -sSf | sh -s -- -y && apt-get install --reinstall libc6-dev -y && pip3 install --no-cache -r requirements.txt \ && rm -rf /root/.cache COPY --chown=searxng:searxng dockerfiles ./dockerfiles diff --git a/requirements-dev.txt b/requirements-dev.txt index e52b0f93f..5a76c8889 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -22,4 +22,7 @@ wlc==1.13 coloredlogs==15.0.1 requests markdown +tiktoken +scipy +numpy git+https://github.com/luxtiasco/TextRank4ZH.git \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d6b4cc226..842ea2f4d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,4 +18,7 @@ typing_extensions==4.5.0 fasttext-predict==0.9.2.1 requests markdown +tiktoken +scipy +numpy git+https://github.com/luxtiasco/TextRank4ZH.git \ No newline at end of file