Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

feat: Added multi-architecture image building and service startup instructions, upgraded Node image and package manager

begoniezhao4ff3ba6d9609
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
new file mode 100644
index 000000000..785794d4c
--- /dev/null
+++ b/.github/workflows/docker-image.yml
@@ -0,0 +1,67 @@
+name: Build and Push Docker Image
+on:
+ push:
+ branches:
+ - main
+jobs:
+ build-app:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ include:
+ - service_name: ui
+ file: frontend/Dockerfile
+ context: ./frontend
+ arch: amd64
+ platform: linux/amd64
+ - service_name: app
+ file: docker/Dockerfile.app
+ context: .
+ arch: amd64
+ platform: linux/amd64
+ - service_name: docreader
+ file: docker/Dockerfile.docreader
+ context: .
+ arch: amd64
+ platform: linux/amd64
+ - service_name: ui
+ file: frontend/Dockerfile
+ context: ./frontend
+ arch: arm64
+ platform: linux/arm64
+ - service_name: app
+ file: docker/Dockerfile.app
+ context: .
+ arch: arm64
+ platform: linux/arm64
+ - service_name: docreader
+ file: docker/Dockerfile.docreader
+ context: .
+ arch: arm64
+ platform: linux/arm64
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
+
+ - name: Build ${{ matrix.service_name }} Image
+ uses: docker/build-push-action@v3
+ with:
+ push: true
+ platforms: ${{ matrix.platform }}
+ file: ${{ matrix.file }}
+ context: ${{ matrix.context }}
+ tags: ${{ secrets.DOCKERHUB_USERNAME }}/weknora-${{ matrix.service_name }}:${{ matrix.arch }}-latest
+ build-args: |
+ PLATFORM=${{ matrix.platform }}
diff --git a/README.md b/README.md
index c37ae1e87..eb0bfc7bb 100644
--- a/README.md
+++ b/README.md
@@ -116,6 +116,18 @@ cp .env.example .env
make start-all
```
+#### ③ 启动服务备选
+
+```bash
+# 启动 ollama 服务 (可选)
+ollama serve > /dev/null 2>&1 &
+
+# 根据系统架构(amd64 或者 arm64)启动服务
+ARCH=amd64 docker compose up -d
+# 或
+ARCH=arm64 docker compose up -d
+```
+
#### ④ 停止服务
```bash
diff --git a/README_EN.md b/README_EN.md
index d9e28ad93..f1982f26c 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -116,6 +116,18 @@ cp .env.example .env
make start-all
```
+#### ③ Start the services (backup)
+
+```bash
+# Start ollama services (Optional)
+ollama serve > /dev/null 2>&1 &
+
+# Start the service according to the system architecture (amd64 or arm64)
+ARCH=amd64 docker compose up -d
+# Or
+ARCH=arm64 docker compose up -d
+```
+
#### ④ Stop the services
```bash
diff --git a/frontend/Dockerfile b/frontend/Dockerfile
index 7fe702597..f1fe3e79e 100644
--- a/frontend/Dockerfile
+++ b/frontend/Dockerfile
@@ -1,5 +1,5 @@
# 构建阶段
-FROM node:20-alpine as build-stage
+FROM node:24-alpine as build-stage
WORKDIR /app
@@ -11,13 +11,14 @@ ENV VITE_IS_DOCKER=true
COPY package*.json ./
# 安装依赖
-RUN npm install
+RUN corepack enable
+RUN pnpm install
# 复制项目文件
COPY . .
# 构建应用
-RUN npm run build
+RUN pnpm run build
# 生产阶段
FROM nginx:stable-alpine as production-stage