Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Add build image and launch from source in README (#2658)

Jin Haia411330b0929
diff --git a/README.md b/README.md
index 45628b2234..5bac9faffa 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,9 @@
- ๐Ÿ”Ž [System Architecture](#-system-architecture)
- ๐ŸŽฌ [Get Started](#-get-started)
- ๐Ÿ”ง [Configurations](#-configurations)
+- ๐Ÿช› [Build the docker image without embedding models](#-build-the-docker-image-without-embedding-models)
+- ๐Ÿชš [Build the docker image including embedding models](#-build-the-docker-image-including-embedding-models)
+- ๐Ÿ”จ [Launch service from source for development](#-launch-service-from-source-for-development)
- ๐Ÿ“š [Documentation](#-documentation)
- ๐Ÿ“œ [Roadmap](#-roadmap)
- ๐Ÿ„ [Community](#-community)
@@ -166,12 +169,12 @@ Try our demo at [https://demo.ragflow.io](https://demo.ragflow.io).
_The following output confirms a successful launch of the system:_
```bash
- ____ ______ __
- / __ \ ____ _ ____ _ / ____// /____ _ __
- / /_/ // __ `// __ `// /_ / // __ \| | /| / /
- / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
- /_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
- /____/
+ ____ ___ ______ ______ __
+ / __ \ / | / ____// ____// /____ _ __
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
+
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
@@ -208,6 +211,84 @@ Updates to the above configurations require a reboot of all containers to take e
> $ docker-compose -f docker/docker-compose.yml up -d
> ```
+## ๐Ÿช› Build the Docker image without embedding models
+
+This image is approximately 1 GB in size and relies on external LLM and embedding services.
+
+```bash
+git clone https://github.com/infiniflow/ragflow.git
+cd ragflow/
+pip3 install huggingface-hub
+python3 download_deps.py # embedding models
+docker build -f Dockerfile.slim -t infiniflow/ragflow:dev-slim .
+```
+
+## ๐Ÿชš Build the Docker image including embedding models
+
+This image includes embedding models and is approximately 9 GB in size, and so relies on external LLM services only.
+
+```bash
+git clone https://github.com/infiniflow/ragflow.git
+cd ragflow/
+pip3 install huggingface-hub
+python3 download_deps.py # embedding models
+docker build -f Dockerfile -t infiniflow/ragflow:dev .
+```
+
+## ๐Ÿ”จ Launch service from source for development
+
+1. Install Poetry, or skip this step if it is already installed:
+ ```bash
+ curl -sSL https://install.python-poetry.org | python3 -
+ ```
+
+2. Clone the source code and install Python dependencies:
+ ```bash
+ git clone https://github.com/infiniflow/ragflow.git
+ cd ragflow/
+ export POETRY_VIRTUALENVS_CREATE=true POETRY_VIRTUALENVS_IN_PROJECT=true
+ ~/.local/bin/poetry install --sync --no-root # install RAGFlow dependent python modules
+ ```
+
+3. Launch the dependent services (MinIO, Elasticsearch, Redis, and MySQL) using Docker Compose:
+ ```bash
+ docker compose -f docker/docker-compose-base.yml up -d
+ ```
+
+ Add the following line to `/etc/hosts` to resolve all hosts specified in **docker/service_conf.yaml** to `127.0.0.1`:
+ ```
+ 127.0.0.1 es01 mysql minio redis
+ ```
+ In **docker/service_conf.yaml**, update mysql port to `5455` and es port to `1200`, as specified in **docker/.env**.
+
+4. If you cannot access HuggingFace, set the `HF_ENDPOINT` environment variable to use a mirror site:
+
+ ```bash
+ export HF_ENDPOINT=https://hf-mirror.com
+ ```
+
+5. Launch backend service:
+ ```bash
+ source .venv/bin/activate
+ export PYTHONPATH=$(pwd)
+ bash docker/launch_backend_service.sh
+ ```
+
+6. Install frontend dependencies:
+ ```bash
+ cd web
+ npm install --force
+ ```
+7. Configure frontend to update `proxy.target` in **.umirc.ts** to `http://127.0.0.1:9380`:
+8. Launch frontend service:
+ ```bash
+ npm run dev
+ ```
+
+ _The following output confirms a successful launch of the system:_
+
+ ![](https://github.com/user-attachments/assets/0daf462c-a24d-4496-a66f-92533534e187)
+
## ๐Ÿ“š Documentation
- [Quickstart](https://ragflow.io/docs/dev/)
diff --git a/README_ja.md b/README_ja.md
index 2f931f82af..0c033529e6 100644
--- a/README_ja.md
+++ b/README_ja.md
@@ -152,12 +152,11 @@
_ไปฅไธ‹ใฎๅ‡บๅŠ›ใฏใ€ใ‚ทใ‚นใƒ†ใƒ ใŒๆญฃๅธธใซ่ตทๅ‹•ใ—ใŸใ“ใจใ‚’็ขบ่ชใ™ใ‚‹ใ‚‚ใฎใงใ™:_
```bash
- ____ ______ __
- / __ \ ____ _ ____ _ / ____// /____ _ __
- / /_/ // __ `// __ `// /_ / // __ \| | /| / /
- / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
- /_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
- /____/
+ ____ ___ ______ ______ __
+ / __ \ / | / ____// ____// /____ _ __
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
diff --git a/README_ko.md b/README_ko.md
index 077cbe33c9..5f05ac1cb8 100644
--- a/README_ko.md
+++ b/README_ko.md
@@ -157,12 +157,11 @@
_๋‹ค์Œ ์ถœ๋ ฅ ๊ฒฐ๊ณผ๋กœ ์‹œ์Šคํ…œ์ด ์„ฑ๊ณต์ ์œผ๋กœ ์‹œ์ž‘๋˜์—ˆ์Œ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค:_
```bash
- ____ ______ __
- / __ \ ____ _ ____ _ / ____// /____ _ __
- / /_/ // __ `// __ `// /_ / // __ \| | /| / /
- / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
- /_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
- /____/
+ ____ ___ ______ ______ __
+ / __ \ / | / ____// ____// /____ _ __
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
diff --git a/README_zh.md b/README_zh.md
index 5a6fe3209c..3e62d8c6cc 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -150,12 +150,11 @@
_ๅ‡บ็Žฐไปฅไธ‹็•Œ้ขๆ็คบ่ฏดๆ˜ŽๆœๅŠกๅ™จๅฏๅŠจๆˆๅŠŸ๏ผš_
```bash
- ____ ______ __
- / __ \ ____ _ ____ _ / ____// /____ _ __
- / /_/ // __ `// __ `// /_ / // __ \| | /| / /
- / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
- /_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
- /____/
+ ____ ___ ______ ______ __
+ / __ \ / | / ____// ____// /____ _ __
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
diff --git a/api/ragflow_server.py b/api/ragflow_server.py
index e5d450c37b..9fabb05ba3 100644
--- a/api/ragflow_server.py
+++ b/api/ragflow_server.py
@@ -47,12 +47,11 @@ def update_progress():
if __name__ == '__main__':
print(r"""
- ____ ______ __
- / __ \ ____ _ ____ _ / ____// /____ _ __
- / /_/ // __ `// __ `// /_ / // __ \| | /| / /
- / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
-/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
- /____/
+ ____ ___ ______ ______ __
+ / __ \ / | / ____// ____// /____ _ __
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
""", flush=True)
stat_logger.info(
diff --git a/docker/launch_backend_service.sh b/docker/launch_backend_service.sh
new file mode 100644
index 0000000000..a3e374cde2
--- /dev/null
+++ b/docker/launch_backend_service.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# unset http proxy which maybe set by docker daemon
+export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
+
+export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
+
+PY=python3
+if [[ -z "$WS" || $WS -lt 1 ]]; then
+ WS=1
+fi
+
+function task_exe(){
+ while [ 1 -eq 1 ];do
+ $PY rag/svr/task_executor.py $1;
+ done
+}
+
+for ((i=0;i<WS;i++))
+do
+ task_exe $i &
+done
+
+while [ 1 -eq 1 ];do
+ $PY api/ragflow_server.py
+done
+
+wait;
diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx
index 6ab4e6a487..c237dd3fc9 100644
--- a/docs/quickstart.mdx
+++ b/docs/quickstart.mdx
@@ -196,12 +196,11 @@ This section provides instructions on setting up the RAGFlow server on Linux. If
_The following output confirms a successful launch of the system:_
```bash
- ____ ______ __
- / __ \ ____ _ ____ _ / ____// /____ _ __
- / /_/ // __ `// __ `// /_ / // __ \| | /| / /
- / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
- /_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
- /____/
+ ____ ___ ______ ______ __
+ / __ \ / | / ____// ____// /____ _ __
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
diff --git a/docs/references/faq.md b/docs/references/faq.md
index d3b8b4649f..8afe45af36 100644
--- a/docs/references/faq.md
+++ b/docs/references/faq.md
@@ -168,12 +168,11 @@ You will not log in to RAGFlow unless the server is fully initialized. Run `dock
*The server is successfully initialized, if your system displays the following:*
```
- ____ ______ __
- / __ \ ____ _ ____ _ / ____// /____ _ __
- / /_/ // __ `// __ `// /_ / // __ \| | /| / /
- / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
-/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
- /____/
+ ____ ___ ______ ______ __
+ / __ \ / | / ____// ____// /____ _ __
+ / /_/ // /| | / / __ / /_ / // __ \| | /| / /
+ / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
+ /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380