mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-01 15:18:00 +08:00
Updated Launch service from source (#856)
### What problem does this PR solve? Some nitpicking editorial updates. ### Type of change - [x] Documentation Update
This commit is contained in:
parent
250119e03a
commit
fe4b2e4670
151
README.md
151
README.md
@ -191,88 +191,99 @@ $ chmod +x ./entrypoint.sh
|
|||||||
$ docker compose up -d
|
$ docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🛠️ Launch Service from Source
|
## 🛠️ Launch service from source
|
||||||
|
|
||||||
To launch the service from source, please follow these steps:
|
To launch the service from source:
|
||||||
|
|
||||||
1. Clone the repository
|
1. Clone the repository:
|
||||||
```bash
|
|
||||||
$ git clone https://github.com/infiniflow/ragflow.git
|
|
||||||
$ cd ragflow/
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Create a virtual environment (ensure Anaconda or Miniconda is installed)
|
```bash
|
||||||
```bash
|
$ git clone https://github.com/infiniflow/ragflow.git
|
||||||
$ conda create -n ragflow python=3.11.0
|
$ cd ragflow/
|
||||||
$ conda activate ragflow
|
```
|
||||||
$ pip install -r requirements.txt
|
|
||||||
```
|
|
||||||
If CUDA version is greater than 12.0, execute the following additional commands:
|
|
||||||
```bash
|
|
||||||
$ pip uninstall -y onnxruntime-gpu
|
|
||||||
$ pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Copy the entry script and configure environment variables
|
2. Create a virtual environment, ensuring that Anaconda or Miniconda is installed:
|
||||||
```bash
|
|
||||||
$ cp docker/entrypoint.sh .
|
|
||||||
$ vi entrypoint.sh
|
|
||||||
```
|
|
||||||
Use the following commands to obtain the Python path and the ragflow project path:
|
|
||||||
```bash
|
|
||||||
$ which python
|
|
||||||
$ pwd
|
|
||||||
```
|
|
||||||
|
|
||||||
Set the output of `which python` as the value for `PY` and the output of `pwd` as the value for `PYTHONPATH`.
|
```bash
|
||||||
|
$ conda create -n ragflow python=3.11.0
|
||||||
|
$ conda activate ragflow
|
||||||
|
$ pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# If your CUDA version is higher than 12.0, run the following additional commands:
|
||||||
|
$ pip uninstall -y onnxruntime-gpu
|
||||||
|
$ pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
|
||||||
|
```
|
||||||
|
|
||||||
If `LD_LIBRARY_PATH` is already configured, it can be commented out.
|
3. Copy the entry script and configure environment variables:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Adjust configurations according to your actual situation; the two export commands are newly added.
|
# Get the Python path:
|
||||||
PY=${PY}
|
$ which python
|
||||||
export PYTHONPATH=${PYTHONPATH}
|
# Get the ragflow project path:
|
||||||
# Optional: Add Hugging Face mirror
|
$ pwd
|
||||||
export HF_ENDPOINT=https://hf-mirror.com
|
```
|
||||||
```
|
|
||||||
|
```bash
|
||||||
|
$ cp docker/entrypoint.sh .
|
||||||
|
$ vi entrypoint.sh
|
||||||
|
```
|
||||||
|
|
||||||
4. Start the base services
|
```bash
|
||||||
```bash
|
# Adjust configurations according to your actual situation (the following two export commands are newly added):
|
||||||
$ cd docker
|
# - Assign the result of `which python` to `PY`.
|
||||||
$ docker compose -f docker-compose-base.yml up -d
|
# - Assign the result of `pwd` to `PYTHONPATH`.
|
||||||
```
|
# - Comment out `LD_LIBRARY_PATH`, if it is configured.
|
||||||
|
# - Optional: Add Hugging Face mirror.
|
||||||
|
PY=${PY}
|
||||||
|
export PYTHONPATH=${PYTHONPATH}
|
||||||
|
export HF_ENDPOINT=https://hf-mirror.com
|
||||||
|
```
|
||||||
|
|
||||||
5. Check the configuration files
|
4. Launch the third-party services (MinIO, Elasticsearch, Redis, and MySQL):
|
||||||
Ensure that the settings in **docker/.env** match those in **conf/service_conf.yaml**. The IP addresses and ports for related services in **service_conf.yaml** should be changed to the local machine IP and ports exposed by the container.
|
|
||||||
|
|
||||||
6. Launch the service
|
```bash
|
||||||
```bash
|
$ cd docker
|
||||||
$ chmod +x ./entrypoint.sh
|
$ docker compose -f docker-compose-base.yml up -d
|
||||||
$ bash ./entrypoint.sh
|
```
|
||||||
```
|
|
||||||
|
|
||||||
7. Start the WebUI service
|
5. Check the configuration files, ensuring that:
|
||||||
```bash
|
|
||||||
$ cd web
|
|
||||||
$ npm install --registry=https://registry.npmmirror.com --force
|
|
||||||
$ vim .umirc.ts
|
|
||||||
# Modify proxy.target to 127.0.0.1:9380
|
|
||||||
$ npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
8. Deploy the WebUI service
|
- The settings in **docker/.env** match those in **conf/service_conf.yaml**.
|
||||||
```bash
|
- The IP addresses and ports for related services in **service_conf.yaml** match the local machine IP and ports exposed by the container.
|
||||||
$ cd web
|
|
||||||
$ npm install --registry=https://registry.npmmirror.com --force
|
6. Launch the RAGFlow backend service:
|
||||||
$ umi build
|
|
||||||
$ mkdir -p /ragflow/web
|
```bash
|
||||||
$ cp -r dist /ragflow/web
|
$ chmod +x ./entrypoint.sh
|
||||||
$ apt install nginx -y
|
$ bash ./entrypoint.sh
|
||||||
$ cp ../docker/nginx/proxy.conf /etc/nginx
|
```
|
||||||
$ cp ../docker/nginx/nginx.conf /etc/nginx
|
|
||||||
$ cp ../docker/nginx/ragflow.conf /etc/nginx/conf.d
|
7. Launch the frontend service:
|
||||||
$ systemctl start nginx
|
|
||||||
```
|
```bash
|
||||||
|
$ cd web
|
||||||
|
$ npm install --registry=https://registry.npmmirror.com --force
|
||||||
|
$ vim .umirc.ts
|
||||||
|
# Update proxy.target to 127.0.0.1:9380
|
||||||
|
$ npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
8. Deploy the frontend service:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd web
|
||||||
|
$ npm install --registry=https://registry.npmmirror.com --force
|
||||||
|
$ umi build
|
||||||
|
$ mkdir -p /ragflow/web
|
||||||
|
$ cp -r dist /ragflow/web
|
||||||
|
$ apt install nginx -y
|
||||||
|
$ cp ../docker/nginx/proxy.conf /etc/nginx
|
||||||
|
$ cp ../docker/nginx/nginx.conf /etc/nginx
|
||||||
|
$ cp ../docker/nginx/ragflow.conf /etc/nginx/conf.d
|
||||||
|
$ systemctl start nginx
|
||||||
|
```
|
||||||
|
|
||||||
## 📚 Documentation
|
## 📚 Documentation
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user