Skip to content

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

chore: Update .dockerignore and GitHub Actions for improved caching

wizardchen0b8ec2ddcf17
diff --git a/.dockerignore b/.dockerignore
index 0c993cf5a..4f7c55801 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,2 +1,75 @@
+# VCS / CI
+.git/
+.github/
+.gitignore
+.gitattributes
+
+# 编辑器 / IDE 本地配置
+.cursor/
+.claude/
+.codebuddy/
+.vscode/
+.idea/
+*.swp
+*.swo
+.DS_Store
+
+# Python 虚拟环境 / 缓存
**/.venv/
-**/.python-version
\ No newline at end of file
+.venv_proto/
+**/.python-version
+**/__pycache__/
+**/*.pyc
+
+# Node / 前端
+# 注意:build-ui 用的 context 是 ./frontend,根 .dockerignore 对它无效,
+# 其它镜像(app/docreader/sandbox)的 Dockerfile 都不引用 frontend/,
+# 所以这里可以直接排除整个 frontend/ 目录。
+**/node_modules/
+frontend/
+WeKnora-Chrome-Extension/
+
+# 日志 / 临时文件
+logs/
+tmp/
+temp/
+*.log
+*.pid
+
+# 本地构建产物 / 二进制
+WeKnora
+WeKnora-lite
+/server
+/dist/
+/build/
+cmd/desktop/build/bin/
+
+# 本地数据 / 模型文件
+/models/
+data/files/
+data/*.db
+data/*.db-wal
+data/*.db-shm
+test/data/mswag.txt
+
+# 敏感文件
+.env
+.env.lite
+*.pem
+*.key
+*.crt
+*_key
+*_secret
+
+# 大的归档/压缩包
+packages/protoc-*.zip
+
+# 本地测试脚本
+configure-ollama.sh
+fix-docker.sh
+/scripts/scale_dev_jobs.sh
+
+# 文档(不影响构建)
+docs/
+*.md
+!README.md
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index 4e43ecb96..87705fb03 100644
--- a/.github/workflows/docker-image.yml
+++ b/.github/workflows/docker-image.yml
@@ -41,8 +41,8 @@ jobs:
context: ./frontend
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
- cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-ui:cache
- cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-ui:cache,mode=max
+ cache-from: type=gha,scope=build-ui
+ cache-to: type=gha,scope=build-ui,mode=max
build-docreader:
runs-on: ubuntu-latest
@@ -90,8 +90,8 @@ jobs:
context: .
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
- cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-docreader:cache
- cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-docreader:cache,mode=max
+ cache-from: type=gha,scope=build-docreader
+ cache-to: type=gha,scope=build-docreader,mode=max
build-sandbox:
runs-on: ubuntu-latest
@@ -123,8 +123,8 @@ jobs:
context: .
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
- cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-sandbox:cache
- cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-sandbox:cache,mode=max
+ cache-from: type=gha,scope=build-sandbox
+ cache-to: type=gha,scope=build-sandbox,mode=max
build-app:
strategy:
@@ -187,8 +187,8 @@ jobs:
${{ format('GO_VERSION_ARG={0}', steps.version.outputs.go_version) }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/weknora-app
- cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-app:cache-${{ env.PLATFORM_PAIR }}
- cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-app:cache-${{ env.PLATFORM_PAIR }},mode=max
+ cache-from: type=gha,scope=build-app-${{ env.PLATFORM_PAIR }}
+ cache-to: type=gha,scope=build-app-${{ env.PLATFORM_PAIR }},mode=max
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
- name: Export digest