diff --git a/DockerFile.backend b/DockerFile.backend new file mode 100644 index 000000000..340a42e36 --- /dev/null +++ b/DockerFile.backend @@ -0,0 +1,11 @@ +FROM nikolaik/python-nodejs:python3.12-nodejs22-slim + +WORKDIR /app + +COPY . . + +RUN uv sync + +EXPOSE 8000 + +CMD uv run server.py --host 0.0.0.0 \ No newline at end of file diff --git a/README.md b/README.md index 4fddc8cb7..46d7feefd 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,24 @@ Open your browser and visit [`http://localhost:3000`](http://localhost:3000) to Explore more details in the [`web`](./web/) directory. +### Quick Deployment (Serverless) + +You can deploy the backend as a Serverless Function using Docker. + +1. Build the Docker image: +```bash +docker build -f DockerFile.backend . -t deer-flow-backend +``` + +2. Deploy the built image to your chosen Serverless platform (e.g., VolcEngine, Alibaba Cloud Functions, AWS Lambda, Google Cloud Functions, etc.) and obtain your Serverless Function Endpoint. Please refer to the documentation of your chosen platform for specific deployment steps. + +3. For frontend deployment, you can use the Deploy button provided by Vercel: + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fbytedance%2Fdeer-flow%2Ftree%2Fmain%2Fweb) + +After deployment, please update the value of the environment variable `NEXT_PUBLIC_API_URL` in the Vercel console to the obtained backend Serverless Function Endpoint plus the `/api` path. For example, if the Endpoint is `https://deer-dkcxax.cn-hongkong.fcapp.run`, `NEXT_PUBLIC_API_URL` should be set to `https://deer-dkcxax.cn-hongkong.fcapp.run/api`. + + ## Supported Search Engines DeerFlow supports multiple search engines that can be configured in your `.env` file using the `SEARCH_API` variable: diff --git a/README_de.md b/README_de.md index f59c1c4e6..dbc783567 100644 --- a/README_de.md +++ b/README_de.md @@ -137,6 +137,24 @@ bootstrap.bat -d Weitere Details finden Sie im Verzeichnis [`web`](./web/). +### Schnelle Bereitstellung (Serverless) + +Sie können das Backend mit Docker als Serverless Function bereitstellen. + +1. Erstellen Sie das Docker-Image: +```bash +docker build -f DockerFile.backend . -t deer-flow-backend +``` + +2. Stellen Sie das erstellte Image auf der von Ihnen gewählten Serverless-Plattform bereit (z. B. VolcEngine, Alibaba Cloud Functions, AWS Lambda, Google Cloud Functions usw.) und erhalten Sie Ihren Serverless Function Endpoint. Spezifische Bereitstellungsschritte finden Sie in der Dokumentation der von Ihnen gewählten Plattform. + +3. Für die Frontend-Bereitstellung können Sie den von Vercel bereitgestellten Bereitstellungsbutton verwenden: + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fbytedance%2Fdeer-flow%2Ftree%2Fmain%2Fweb) + +Nach der Bereitstellung aktualisieren Sie bitte den Wert der Umgebungsvariable `NEXT_PUBLIC_API_URL` in der Vercel-Konsole auf den erhaltenen Backend Serverless Function Endpoint plus den Pfad `/api`. Wenn der Endpoint beispielsweise `https://deer-dkcxax.cn-hongkong.fcapp.run` ist, sollte `NEXT_PUBLIC_API_URL` auf `https://deer-dkcxax.cn-hongkong.fcapp.run/api` gesetzt werden. + + ## Unterstützte Suchmaschinen DeerFlow unterstützt mehrere Suchmaschinen, die in Ihrer `.env`-Datei über die Variable `SEARCH_API` konfiguriert werden können: diff --git a/README_ja.md b/README_ja.md index 439159152..7f52a5fb5 100644 --- a/README_ja.md +++ b/README_ja.md @@ -135,6 +135,24 @@ bootstrap.bat -d [`web`](./web/)ディレクトリで詳細を確認できます。 +### 高速デプロイ (Serverless) + +Docker を使用してバックエンドを Serverless Function としてデプロイできます。 + +1. Docker イメージをビルドします: +```bash +docker build -f DockerFile.backend . -t deer-flow-backend +``` + +2. ビルドしたイメージを選択した Serverless プラットフォーム(例:VolcEngine, Alibaba Cloud Functions, AWS Lambda, Google Cloud Functions など)にデプロイし、Serverless Function Endpoint を取得します。具体的なデプロイ手順については、選択したプラットフォームのドキュメントを参照してください。 + +3. フロントエンドのデプロイには、Vercel が提供するデプロイボタンを使用できます: + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fbytedance%2Fdeer-flow%2Ftree%2Fmain%2Fweb) + +デプロイ後、Vercel コンソールで環境変数 `NEXT_PUBLIC_API_URL` の値を、取得したバックエンド Serverless Function Endpoint に `/api` パスを追加したものに更新してください。例えば、Endpoint が `https://deer-dkcxax.cn-hongkong.fcapp.run` の場合、`NEXT_PUBLIC_API_URL` は `https://deer-dkcxax.cn-hongkong.fcapp.run/api` に設定する必要があります。 + + ## サポートされている検索エンジン DeerFlowは複数の検索エンジンをサポートしており、`.env`ファイルの`SEARCH_API`変数で設定できます: diff --git a/README_zh.md b/README_zh.md index 550d60930..3f07fea13 100644 --- a/README_zh.md +++ b/README_zh.md @@ -135,6 +135,24 @@ bootstrap.bat -d 在[`web`](./web/)目录中探索更多详情。 +### 快速部署 (Serverless) + +可以使用 Docker 将后端部署为 Serverless Function。 + +1. 构建 Docker 镜像: +```bash +docker build -f DockerFile.backend . -t deer-flow-backend +``` + +2. 将构建好的镜像部署到您选择的 Serverless 平台(例如 火山引擎, 阿里云函数计算, AWS Lambda, Google Cloud Functions 等),并获取您的 Serverless Function Endpoint。具体部署步骤请参考您所选平台的文档。 + +3. 对于前端部署,可以使用 Vercel 提供的部署按钮: + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fbytedance%2Fdeer-flow%2Ftree%2Fmain%2Fweb) + +部署完成后,请在 Vercel 控制台中配置环境变量 `NEXT_PUBLIC_API_URL` 的值更新为获取的后端 Serverless Function Endpoint 加上 `/api` 路径。例如,如果 Endpoint 是 `https://deer-dkcxax.cn-hongkong.fcapp.run`,则 `NEXT_PUBLIC_API_URL` 应设置为 `https://deer-dkcxax.cn-hongkong.fcapp.run/api`。 + + ## 支持的搜索引擎 DeerFlow支持多种搜索引擎,可以在`.env`文件中通过`SEARCH_API`变量进行配置: