diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e38413d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# 使用官方 Python 基础镜像 +FROM python:3.9 + +# 设置工作目录 +WORKDIR / + +# 将当前目录内容复制到容器的 / 目录 +COPY . / + +# 安装 Python 依赖 +RUN pip install --no-cache-dir -r requirements.txt + +# 切换到 web 目录,安装 Node.js 依赖并构建 web 应用 +WORKDIR /web +RUN npm install && npm run build + +# 切换回根目录 +WORKDIR / + +# 运行 Python 服务器 +CMD ["python", "search4all.py"] \ No newline at end of file diff --git a/README.md b/README.md index d4d5d0b..86cc214 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,12 @@ To use the Bing Web Search API, please visit [this link](https://www.microsoft.c ### Google Search You have three options for Google Search: you can use the [SearchApi Google Search API](https://www.searchapi.io/) from SearchApi, [Serper Google Search API](https://www.serper.dev) from Serper, or opt for the [Programmable Search Engine](https://developers.google.com/custom-search) provided by Google. -## Setup LLM and KV - -> [!NOTE] -> We recommend using the built-in llm and kv functions with Lepton. -> Running the following commands to set up them automatically. ```shell -pip install -U leptonai && lep login +pip3 install requirements.txt ``` -## Build - 1. Set Bing subscription key ```shell export BING_SEARCH_V7_SUBSCRIPTION_KEY=YOUR_BING_SUBSCRIPTION_KEY @@ -67,19 +60,3 @@ export GOOGLE_SEARCH_API_KEY=YOUR_GOOGLE_SEARCH_API_KEY export GOOGLE_SEARCH_CX=YOUR_GOOGLE_SEARCH_ENGINE_ID BACKEND=GOOGLE python search4all.py ``` - - - -## Deploy - -You can deploy this to Lepton AI with one click: - -[![Deploy with Lepton AI](https://github.com/leptonai/search_with_lepton/assets/1506722/bbd40afa-69ee-4acb-8974-d060880a183a)](https://dashboard.lepton.ai/workspace-redirect/explore/detail/search-by-lepton) - -You can also deploy your own version via - -```shell -lep photon run -n search-with-lepton-modified -m search4all.py --env BACKEND=BING --env BING_SEARCH_V7_SUBSCRIPTION_KEY=YOUR_BING_SUBSCRIPTION_KEY -``` - -Learn more about `lep photon` [here](https://www.lepton.ai/docs).