imbajin commented on code in PR #280:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/280#discussion_r2165470045


##########
hugegraph-llm/README.md:
##########
@@ -30,27 +30,66 @@ You can choose one of the following two deployment methods:
 
 ### 3.1 Docker Deployment
 
-**Docker Deployment**  
-   Deploy HugeGraph-AI using Docker for quick setup:
-   - Ensure Docker is installed
-   - We provide two container images to choose from:
+**Option 1: Network-based Deployment (Recommended)**

Review Comment:
   ```suggestion
   **Option 1: Network-composed Deployment (Recommended)**
   ```



##########
docker/env.template:
##########


Review Comment:
   How do users know the key of configuration items 🤔 



##########
docker/docker-compose-network.yml:
##########
@@ -0,0 +1,51 @@
+networks:
+  hugegraph-network:
+    driver: bridge
+
+services:
+  # HugeGraph Server
+  hugegraph-server:
+    image: hugegraph/hugegraph
+    container_name: server
+    restart: unless-stopped
+    ports:
+      - "8080:8080"
+    networks:
+      - hugegraph-network
+    environment:
+      - HUGEGRAPH_HOST=0.0.0.0
+      - HUGEGRAPH_PORT=8080
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://localhost:8080/versions";]
+      interval: 30s
+      timeout: 10s
+      retries: 3
+      start_period: 40s
+
+  # HugeGraph LLM RAG Service
+  hugegraph-rag:
+    image: hugegraph/rag
+    container_name: rag
+    restart: unless-stopped
+    ports:
+      - "8001:8001"
+    volumes:
+      # Mount .env file, please modify according to actual path
+      - ${PROJECT_PATH}/hugegraph-llm/.env:/home/work/hugegraph-llm/.env
+      # Optional: mount resources file
+      # - 
${PROJECT_PATH}/hugegraph-llm/src/hugegraph_llm/resources:/home/work/hugegraph-llm/src/hugegraph_llm/resources
+    networks:
+      - hugegraph-network
+    environment:
+      # Set HugeGraph server address, use container name as hostname
+      - HUGEGRAPH_HOST=server
+      - HUGEGRAPH_PORT=8080
+    depends_on:
+      hugegraph-server:
+        condition: service_healthy
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://localhost:8001/";]
+      interval: 30s
+      timeout: 10s
+      retries: 3
+      start_period: 60s 

Review Comment:
   ```suggestion
         start_period: 60s 
   
   ```



##########
hugegraph-llm/README.md:
##########
@@ -30,27 +30,66 @@ You can choose one of the following two deployment methods:
 
 ### 3.1 Docker Deployment
 
-**Docker Deployment**  
-   Deploy HugeGraph-AI using Docker for quick setup:
-   - Ensure Docker is installed
-   - We provide two container images to choose from:
+**Option 1: Network-based Deployment (Recommended)**
+
+For production environments, we recommend using Docker Compose to deploy both 
HugeGraph Server and HugeGraph LLM RAG Service in the same network:
+
+1. **Set up environment variables:**
+   ```bash
+   # Copy the template and modify the project path
+   cp docker/env.template docker/.env
+   # Edit docker/.env and set PROJECT_PATH to your actual project path
+   ```
+
+2. **Start the containers:**
+   ```bash
+   cd docker
+   docker-compose -f docker-compose-network.yml up -d
+   ```
+
+3. **Check container status:**
+   ```bash
+   docker-compose -f docker-compose-network.yml ps
+   ```
+
+4. **Access the services:**
+   - HugeGraph Server: http://localhost:8080
+   - RAG Service: http://localhost:8001
+
+**Option 2: Individual Container Deployment**
+
+Alternatively, you can deploy HugeGraph-AI using individual Docker containers:
+   - Ensure you have Docker installed
+   - We provide two container images:
      - **Image 1**: 
[hugegraph/rag](https://hub.docker.com/r/hugegraph/rag/tags)  
        For building and running RAG functionality for rapid deployment and 
direct source code modification
      - **Image 2**: 
[hugegraph/rag-bin](https://hub.docker.com/r/hugegraph/rag-bin/tags)  
-       A binary translation of C compiled with Nuitka, for better performance 
and efficiency.
-   - Pull one of the Docker images:
-     ```bash
-     docker pull hugegraph/rag:latest     # Pull Image 1
-     docker pull hugegraph/rag-bin:latest # Pull Image 2
-     ```
-   - Start one of the Docker containers:
-     ```bash
-     # Replace '/path/to/.env' with your actual .env file path
-     docker run -itd --name rag -v /path/to/.env:/home/work/hugegraph-llm/.env 
-p 8001:8001 hugegraph/rag
-     # or
-     docker run -itd --name rag-bin -v 
/path/to/.env:/home/work/hugegraph-llm/.env -p 8001:8001 hugegraph/rag-bin
-     ```
-   - Access the interface at http://localhost:8001
+       Binary version compiled with Nuitka for more stable and efficient 
performance in production
+
+1. **Create Hugegraph Network:**
+   ```bash
+   docker network create -d bridge hugegraph-net
+   ```
+
+2. **Start HugeGraph Server:**
+   ```bash
+   docker run -itd --name=server -p 8080:8080 --network hugegraph-net 
hugegraph/hugegraph
+   ```
+
+3. **Start RAG Service:**
+   ```bash
+   # Pull the Docker image
+   docker pull hugegraph/rag:latest
+   # or
+   docker pull hugegraph/rag-bin:latest
+   
+   # Start the RAG container (replace /path/to/your/project with actual path)
+   docker run -it --name rag -v 
path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 
--network hugegraph-net hugegraph/rag

Review Comment:
   ```suggestion
      # Run it (replace /path2project with actual path) & modify .env file for 
your needs
      docker run -it --name rag -v 
/path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 
--network hugegraph-net hugegraph/rag
   ```



##########
hugegraph-llm/README.md:
##########
@@ -30,27 +30,66 @@ You can choose one of the following two deployment methods:
 
 ### 3.1 Docker Deployment
 
-**Docker Deployment**  
-   Deploy HugeGraph-AI using Docker for quick setup:
-   - Ensure Docker is installed
-   - We provide two container images to choose from:
+**Option 1: Network-based Deployment (Recommended)**
+
+For production environments, we recommend using Docker Compose to deploy both 
HugeGraph Server and HugeGraph LLM RAG Service in the same network:
+
+1. **Set up environment variables:**
+   ```bash
+   # Copy the template and modify the project path
+   cp docker/env.template docker/.env
+   # Edit docker/.env and set PROJECT_PATH to your actual project path
+   ```
+
+2. **Start the containers:**
+   ```bash
+   cd docker
+   docker-compose -f docker-compose-network.yml up -d
+   ```
+
+3. **Check container status:**
+   ```bash
+   docker-compose -f docker-compose-network.yml ps
+   ```
+
+4. **Access the services:**
+   - HugeGraph Server: http://localhost:8080
+   - RAG Service: http://localhost:8001
+
+**Option 2: Individual Container Deployment**
+
+Alternatively, you can deploy HugeGraph-AI using individual Docker containers:
+   - Ensure you have Docker installed
+   - We provide two container images:
      - **Image 1**: 
[hugegraph/rag](https://hub.docker.com/r/hugegraph/rag/tags)  
        For building and running RAG functionality for rapid deployment and 
direct source code modification
      - **Image 2**: 
[hugegraph/rag-bin](https://hub.docker.com/r/hugegraph/rag-bin/tags)  
-       A binary translation of C compiled with Nuitka, for better performance 
and efficiency.
-   - Pull one of the Docker images:
-     ```bash
-     docker pull hugegraph/rag:latest     # Pull Image 1
-     docker pull hugegraph/rag-bin:latest # Pull Image 2
-     ```
-   - Start one of the Docker containers:
-     ```bash
-     # Replace '/path/to/.env' with your actual .env file path
-     docker run -itd --name rag -v /path/to/.env:/home/work/hugegraph-llm/.env 
-p 8001:8001 hugegraph/rag
-     # or
-     docker run -itd --name rag-bin -v 
/path/to/.env:/home/work/hugegraph-llm/.env -p 8001:8001 hugegraph/rag-bin
-     ```
-   - Access the interface at http://localhost:8001
+       Binary version compiled with Nuitka for more stable and efficient 
performance in production
+
+1. **Create Hugegraph Network:**
+   ```bash
+   docker network create -d bridge hugegraph-net
+   ```
+
+2. **Start HugeGraph Server:**
+   ```bash
+   docker run -itd --name=server -p 8080:8080 --network hugegraph-net 
hugegraph/hugegraph
+   ```
+
+3. **Start RAG Service:**
+   ```bash
+   # Pull the Docker image
+   docker pull hugegraph/rag:latest
+   # or
+   docker pull hugegraph/rag-bin:latest
+   
+   # Start the RAG container (replace /path/to/your/project with actual path)
+   docker run -it --name rag -v 
path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 
--network hugegraph-net hugegraph/rag
+   # or
+   docker run -it --name rag-bin -v 
path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 
--network hugegraph-net hugegraph/rag-bin

Review Comment:
   ```suggestion
      # same as the "rag-bin" image...
   ```



##########
hugegraph-llm/README.md:
##########
@@ -30,27 +30,66 @@ You can choose one of the following two deployment methods:
 
 ### 3.1 Docker Deployment
 
-**Docker Deployment**  
-   Deploy HugeGraph-AI using Docker for quick setup:
-   - Ensure Docker is installed
-   - We provide two container images to choose from:
+**Option 1: Network-based Deployment (Recommended)**
+
+For production environments, we recommend using Docker Compose to deploy both 
HugeGraph Server and HugeGraph LLM RAG Service in the same network:
+
+1. **Set up environment variables:**
+   ```bash
+   # Copy the template and modify the project path
+   cp docker/env.template docker/.env
+   # Edit docker/.env and set PROJECT_PATH to your actual project path
+   ```
+
+2. **Start the containers:**
+   ```bash
+   cd docker
+   docker-compose -f docker-compose-network.yml up -d
+   ```
+
+3. **Check container status:**
+   ```bash
+   docker-compose -f docker-compose-network.yml ps
+   ```
+
+4. **Access the services:**
+   - HugeGraph Server: http://localhost:8080
+   - RAG Service: http://localhost:8001
+
+**Option 2: Individual Container Deployment**
+
+Alternatively, you can deploy HugeGraph-AI using individual Docker containers:
+   - Ensure you have Docker installed
+   - We provide two container images:
      - **Image 1**: 
[hugegraph/rag](https://hub.docker.com/r/hugegraph/rag/tags)  
        For building and running RAG functionality for rapid deployment and 
direct source code modification
      - **Image 2**: 
[hugegraph/rag-bin](https://hub.docker.com/r/hugegraph/rag-bin/tags)  
-       A binary translation of C compiled with Nuitka, for better performance 
and efficiency.
-   - Pull one of the Docker images:
-     ```bash
-     docker pull hugegraph/rag:latest     # Pull Image 1
-     docker pull hugegraph/rag-bin:latest # Pull Image 2
-     ```
-   - Start one of the Docker containers:
-     ```bash
-     # Replace '/path/to/.env' with your actual .env file path
-     docker run -itd --name rag -v /path/to/.env:/home/work/hugegraph-llm/.env 
-p 8001:8001 hugegraph/rag
-     # or
-     docker run -itd --name rag-bin -v 
/path/to/.env:/home/work/hugegraph-llm/.env -p 8001:8001 hugegraph/rag-bin
-     ```
-   - Access the interface at http://localhost:8001
+       Binary version compiled with Nuitka for more stable and efficient 
performance in production
+
+1. **Create Hugegraph Network:**
+   ```bash
+   docker network create -d bridge hugegraph-net
+   ```
+
+2. **Start HugeGraph Server:**
+   ```bash
+   docker run -itd --name=server -p 8080:8080 --network hugegraph-net 
hugegraph/hugegraph
+   ```
+
+3. **Start RAG Service:**
+   ```bash
+   # Pull the Docker image
+   docker pull hugegraph/rag:latest
+   # or
+   docker pull hugegraph/rag-bin:latest
+   
+   # Start the RAG container (replace /path/to/your/project with actual path)
+   docker run -it --name rag -v 
path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 
--network hugegraph-net hugegraph/rag
+   # or
+   docker run -it --name rag-bin -v 
path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 
--network hugegraph-net hugegraph/rag-bin
+   ```
+
+4. **Access the interface at http://localhost:8001**

Review Comment:
   ```suggestion
   4. **Access the UI at http://localhost:8001**
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to