Skip to content

Commit f2c41a0

Browse files
committed
docs: Update deployment instructions in README and tutorials, add Docker Hub deployment methods, and introduce new Docker Hub publish scripts
1 parent 7137e8c commit f2c41a0

File tree

10 files changed

+557
-40
lines changed

10 files changed

+557
-40
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Publish to Docker Hub
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*" # 当推送版本标签时触发
7+
workflow_dispatch: # 允许手动触发
8+
inputs:
9+
version:
10+
description: "版本号 (例如: v1.0.0)"
11+
required: true
12+
default: "latest"
13+
14+
env:
15+
DOCKERHUB_LOGIN_USERNAME: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }}
16+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
17+
PROJECT_NAME: gc-qa-rag
18+
19+
jobs:
20+
build-and-push:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Login to Docker Hub
31+
uses: docker/login-action@v3
32+
with:
33+
username: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
36+
- name: Extract version
37+
id: version
38+
run: |
39+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
40+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
41+
else
42+
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
43+
fi
44+
45+
- name: Build and push Server image
46+
uses: docker/build-push-action@v5
47+
with:
48+
context: ./sources/gc-qa-rag-server
49+
push: true
50+
tags: |
51+
${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-server:${{ steps.version.outputs.version }}
52+
${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-server:latest
53+
cache-from: type=gha
54+
cache-to: type=gha,mode=max
55+
56+
- name: Build and push ETL image
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: ./sources/gc-qa-rag-etl
60+
push: true
61+
tags: |
62+
${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-etl:${{ steps.version.outputs.version }}
63+
${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-etl:latest
64+
cache-from: type=gha
65+
cache-to: type=gha,mode=max
66+
67+
- name: Build and push Frontend image
68+
uses: docker/build-push-action@v5
69+
with:
70+
context: ./sources/gc-qa-rag-frontend
71+
push: true
72+
tags: |
73+
${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-frontend:${{ steps.version.outputs.version }}
74+
${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-frontend:latest
75+
cache-from: type=gha
76+
cache-to: type=gha,mode=max
77+
78+
- name: Create Release
79+
if: github.event_name != 'workflow_dispatch'
80+
uses: actions/create-release@v1
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
with:
84+
tag_name: ${{ steps.version.outputs.version }}
85+
release_name: Release ${{ steps.version.outputs.version }}
86+
body: |
87+
## 🚀 GC-QA-RAG ${{ steps.version.outputs.version }}
88+
89+
### 📦 Docker 镜像
90+
91+
本次发布包含以下 Docker 镜像:
92+
93+
- `${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-server:${{ steps.version.outputs.version }}`
94+
- `${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-etl:${{ steps.version.outputs.version }}`
95+
- `${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT_NAME }}-frontend:${{ steps.version.outputs.version }}`
96+
97+
### 🐳 快速部署
98+
99+
```bash
100+
# 使用 Docker Hub 镜像部署
101+
cd sources/gc-qa-rag-server/deploy
102+
docker compose -f docker-compose.dockerhub.yml up -d
103+
```
104+
105+
### 📚 文档
106+
107+
- [部署指南](https://grapecity-ai.github.io/gc-qa-rag/zh/2-%E5%BC%80%E5%8F%91%E6%95%99%E7%A8%8B/1-Docker%E9%83%A8%E7%BD%B2/)
108+
- [项目文档](https://grapecity-ai.github.io/gc-qa-rag/)
109+
draft: false
110+
prerelease: false

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,26 @@ GC-QA-RAG 是一个**企业级的检索增强生成(RAG)系统**。我们通
8181

8282
**第二步:配置和部署**
8383

84-
知识库部署:
84+
#### 方法一:使用 Docker Hub 镜像(推荐)
85+
86+
```bash
87+
# 1. 克隆项目
88+
git clone https://github.com/GrapeCity-AI/gc-qa-rag.git
89+
cd gc-qa-rag
90+
91+
# 2. 配置API密钥 (必须!)
92+
# 编辑 sources/gc-qa-rag-etl/.config.production.json
93+
# 编辑 sources/gc-qa-rag-server/.config.production.json
94+
# 填入您的API密钥
95+
96+
# 3. 进入部署目录
97+
cd sources/gc-qa-rag-server/deploy
98+
99+
# 4. 使用 Docker Hub 镜像启动服务
100+
docker compose -f docker-compose.dockerhub.yml up -d
101+
```
102+
103+
#### 方法二:本地构建镜像
85104

86105
```bash
87106
# 1. 克隆项目
@@ -102,9 +121,21 @@ docker compose up -d --build
102121

103122
ETL 管理后台部署:
104123

124+
#### 方法一:使用 Docker Hub 镜像(推荐)
125+
126+
```bash
127+
# 1. 进入 ETL 目录
128+
cd sources/gc-qa-rag-etl/deploy
129+
130+
# 2. 使用 Docker Hub 镜像启动服务
131+
docker compose -f docker-compose.dockerhub.yml up -d
132+
```
133+
134+
#### 方法二:本地构建镜像
135+
105136
```bash
106137
# 1. 进入 ETL 目录
107-
cd sources/gc-qa-rag-etl
138+
cd sources/gc-qa-rag-etl/deploy
108139

109140
# 2. 构建 Docker 镜像
110141
docker compose up -d --build

docs/en/2-development-tutorial/1-docker-deployment.md

Lines changed: 89 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,30 @@ The `das` section in the configuration file is for the **Data Acquisition System
9494

9595
### 3.1 Deployment Method Selection
9696

97-
The system provides two one-click deployment methods. You can choose based on your needs:
97+
The system provides three one-click deployment methods. You can choose based on your needs:
9898

99-
#### Method 1: Auto-Build Deployment (Recommended for Beginners)
99+
#### Method 1: Docker Hub Image Deployment (Recommended for Production)
100+
101+
Using `docker-compose.dockerhub.yml`, uses pre-published Docker Hub images:
102+
103+
```bash
104+
# Navigate to deployment directory
105+
cd sources/gc-qa-rag-server/deploy
106+
107+
# Start services using Docker Hub images
108+
docker compose -f docker-compose.dockerhub.yml up -d
109+
```
110+
111+
**Use Cases**:
112+
113+
- ✅ Production environment deployment
114+
- ✅ Quick startup (no build time required)
115+
- ✅ Using stable versions
116+
- ✅ Good network environment
117+
118+
**Note**: Before using, you need to replace `your-dockerhub-username` in the configuration file with your actual Docker Hub username.
119+
120+
#### Method 2: Auto-Build Deployment (Recommended for Beginners)
100121

101122
Using `docker-compose.yml`, the system will automatically build the latest code:
102123

@@ -115,9 +136,9 @@ docker compose up -d --build
115136
- ✅ Want to use latest code
116137
- ✅ Don't want to manually build images
117138

118-
#### Method 2: Pre-Built Image Deployment (Recommended for Production)
139+
#### Method 3: Pre-Built Image Deployment
119140

120-
Using `docker-compose.image.yml`, uses pre-built images:
141+
Using `docker-compose.image.yml`, uses locally pre-built images:
121142

122143
```bash
123144
# Navigate to deployment directory
@@ -136,10 +157,9 @@ docker compose -f docker-compose.image.yml up -d
136157

137158
**Use Cases**:
138159

139-
- ✅ Production environment deployment
140160
- ✅ Strict version control environment
141-
- ✅ Existing image registry
142-
-Quick startup (no build time required)
161+
- ✅ Existing local image registry
162+
-Limited network environment
143163

144164
### 3.2 Service Components
145165

@@ -161,6 +181,18 @@ Both deployment methods include complete RAG system core services:
161181

162182
The ETL module is responsible for data collection, processing, and vectorization, and is an important component of the complete RAG system. It needs to be deployed separately after core services are started:
163183

184+
#### Method 1: Docker Hub Image Deployment (Recommended)
185+
186+
```bash
187+
# Navigate to ETL directory
188+
cd sources/gc-qa-rag-etl/deploy
189+
190+
# Start services using Docker Hub images
191+
docker compose -f docker-compose.dockerhub.yml up -d
192+
```
193+
194+
#### Method 2: Local Build Deployment
195+
164196
```bash
165197
# Navigate to ETL directory
166198
cd sources/gc-qa-rag-etl
@@ -202,7 +234,17 @@ ETL Application:
202234

203235
Choose the corresponding stop command based on the deployment method you used:
204236

205-
#### Method 1: Auto-Build Deployment
237+
#### Method 1: Docker Hub Image Deployment
238+
239+
```bash
240+
# Stop all services
241+
docker compose -f docker-compose.dockerhub.yml down
242+
243+
# Stop services and delete data volumes (use with caution)
244+
docker compose -f docker-compose.dockerhub.yml down -v
245+
```
246+
247+
#### Method 2: Auto-Build Deployment
206248

207249
```bash
208250
# Stop all services
@@ -212,7 +254,7 @@ docker compose down
212254
docker compose down -v
213255
```
214256

215-
#### Method 2: Pre-Built Image Deployment
257+
#### Method 3: Pre-Built Image Deployment
216258

217259
```bash
218260
# Stop all services
@@ -224,6 +266,15 @@ docker compose -f docker-compose.image.yml down -v
224266

225267
#### Stop ETL Service
226268

269+
**Docker Hub Image Deployment:**
270+
271+
```bash
272+
# Stop ETL service
273+
docker compose -f docker-compose.dockerhub.yml down
274+
```
275+
276+
**Local Build Deployment:**
277+
227278
```bash
228279
# Stop ETL service
229280
docker stop rag-etl
@@ -514,6 +565,34 @@ docker network ls
514565
docker network inspect rag_network
515566
```
516567

568+
### 8.5 Docker Hub Image Related Issues
569+
570+
#### Q: Failed to pull image, showing "manifest not found"
571+
572+
A: Check if the image name is correct and confirm the image has been published to Docker Hub
573+
574+
#### Q: Failed to start using Docker Hub images
575+
576+
A: Confirm that you have correctly modified the username in the configuration file and check network connectivity
577+
578+
#### Q: How to update to the latest version of images
579+
580+
A: Use the following commands to pull the latest images:
581+
582+
```bash
583+
docker pull grapecitysoftware/gc-qa-rag-server:latest
584+
docker pull grapecitysoftware/gc-qa-rag-frontend:latest
585+
docker pull grapecitysoftware/gc-qa-rag-etl:latest
586+
```
587+
588+
#### Q: How to view image version information
589+
590+
A: Use the following command to view image details:
591+
592+
```bash
593+
docker inspect your-username/gc-qa-rag-server:latest
594+
```
595+
517596
## 9. Monitoring and Maintenance
518597

519598
### 9.1 Container Status Monitoring
@@ -529,4 +608,4 @@ docker compose logs -f server
529608
docker stats
530609
```
531610

532-
Through the above steps, you can successfully deploy the GC-QA-RAG system. One-click deployment is recommended as it's simple, quick, and fully configured.
611+
Through the above steps, you can successfully deploy the GC-QA-RAG system. Docker Hub image deployment is recommended as it's simple, quick, and fully configured.

0 commit comments

Comments
 (0)