Reference:https://docs.requarks.io/dev
首先配置 好 Docker-Desktop 的代理 #Docker 镜像与代理,以及 wiki\.devcontainer\devcontainer.json
的代理,以下适配 V2rayN 代理
"remoteEnv": {
"HTTP_PROXY": "http://host.docker.internal:10809",
"HTTPS_PROXY": "http://host.docker.internal:10809",
"ALL_PROXY": "socks5://host.docker.internal:10808"
}
在 vscode 中安装 Remote Development 插件后,在项目根目录 /wiki
中 reopen in container,之后建议使用 yarn build
和 yarn start
进行项目的编译和启动(原作者推荐的 yarn dev
可以实现HMR,但是一直没能正确实现)
查询某个文件不同
git log -- filename .\engine.js
git diff 9a739ae91bcf907d9dd532035b2a8e7b356bfd09 d0e467eff6f8ec16f953a33e870722488264fa0a -- filename .\engine.js
删除本地文件重新拉取github上的内容
git worktree list
git worktree remove D:/DockerServer/docker-wikijs/wiki-development/wiki --force
git worktree prune
git fetch origin
git reset --hard origin/main
git clean -fd
修改提交,注意 tag 会触发 GitHub Action,这里没有设置
git add .
git commit -m "提交的内容介绍"
git push origin main
git tag v2.5.306.01
git push origin v2.5.306.01
注意 .gitignore
需要放在 repo
根目录,而不是在 .git
文件夹中
git rm -r --cached .webpack-cache/ assets/ data/
git commit -m "Remove unwanted files from Git tracking"
git push origin main
# Build
docker build -t ring/wiki -f dev/build/Dockerfile .
# 测试
docker run -d -p 4000:3000 --name ringwikijs --restart unless-stopped -e "DB_TYPE=postgres" -e "DB_HOST=host.docker.internal" -e "DB_PORT=5432" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" -v D:/DockerServer/docker-wikijs/ob2wiki:/mnt/ob2wiki -v wikijs-wiki_data_content:/wiki/data/conten ring/wiki
# 部署
docker run -d -p 5960:3000 --name wikijs --restart unless-stopped -e "DB_TYPE=postgres" -e "DB_HOST=host.docker.internal" -e "DB_PORT=5432" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" -v D:/DockerServer/docker-wikijs/ob2wiki:/mnt/ob2wiki -v wikijs-wiki_data_content:/wiki/data/conten ring/wiki
基于 Release v2.5.306 · requarks/wiki 基础上开始修改,修改记录在 RingsGit/wiki,
search context + markdown-it-attr · RingsGit/wiki@46c6777
wiki\tsconfig.json
wiki\.devcontainer\devcontainer.json
wiki\client\componets\search-results.vue
wiki\server\modules\search\elasticsearch\engine.js
wiki\.github\workflows\build.yml
dev: "false"
避免出现警告 wiki\package.json
client/themes/default/components/nav-footer.vue
去掉 powered bywiki\server\modules\search\elasticsearch\engine.js
wiki\client\componets\search-results.vue
最好现查看以下是否有效
C:\Users\<username>\.docker\daemon.json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.hpcloud.cloud",
"https://docker.m.daocloud.io",
"https://docker.unsee.tech",
"https://docker.1panel.live",
"http://mirrors.ustc.edu.cn",
"https://docker.chenby.cn",
"http://mirror.azure.cn",
"https://dockerpull.org",
"https://dockerhub.icu",
"https://hub.rat.dev"
]
}
这个是针对 V2rayN 的配置,无论 选择 自动配置系统代理 还是 PAC,都很难处理 docker 在 build 还有 pull 等操作对网络的需求。
wsl --install -d Ubuntu-20.04
wsl --set-default Ubuntu-20.04