From d13d9c34e7a90fa272e11fb1bceaa0cb30d46302 Mon Sep 17 00:00:00 2001 From: Jacky Date: Tue, 4 Feb 2025 10:25:51 +0800 Subject: [PATCH] chore(devcontainer): update docs --- docs/.vitepress/config/en.ts | 1 + docs/.vitepress/config/zh_CN.ts | 1 + docs/.vitepress/config/zh_TW.ts | 1 + docs/guide/devcontainer.md | 50 ++++++++++++++++++++++++++++++++ docs/zh_CN/guide/devcontainer.md | 48 ++++++++++++++++++++++++++++++ docs/zh_TW/guide/devcontainer.md | 48 ++++++++++++++++++++++++++++++ 6 files changed, 149 insertions(+) create mode 100644 docs/guide/devcontainer.md create mode 100644 docs/zh_CN/guide/devcontainer.md create mode 100644 docs/zh_TW/guide/devcontainer.md diff --git a/docs/.vitepress/config/en.ts b/docs/.vitepress/config/en.ts index 96534aeb..3997a5e7 100644 --- a/docs/.vitepress/config/en.ts +++ b/docs/.vitepress/config/en.ts @@ -24,6 +24,7 @@ export const enConfig: LocaleSpecificConfig = { text: 'Development', collapsed: false, items: [ + { text: 'Devcontainer', link: '/guide/devcontainer' }, { text: 'Build', link: '/guide/build' }, { text: 'Project Structure', link: '/guide/project-structure' }, { text: 'Config Template', link: '/guide/nginx-ui-template' }, diff --git a/docs/.vitepress/config/zh_CN.ts b/docs/.vitepress/config/zh_CN.ts index 815e522e..433853c9 100644 --- a/docs/.vitepress/config/zh_CN.ts +++ b/docs/.vitepress/config/zh_CN.ts @@ -29,6 +29,7 @@ export const zhCNConfig: LocaleSpecificConfig = { text: '开发', collapsed: false, items: [ + { text: '开发容器', link: '/zh_CN/guide/devcontainer' }, { text: '构建', link: '/zh_CN/guide/build' }, { text: '项目结构', link: '/zh_CN/guide/project-structure' }, { text: '配置模板', link: '/zh_CN/guide/nginx-ui-template' }, diff --git a/docs/.vitepress/config/zh_TW.ts b/docs/.vitepress/config/zh_TW.ts index 9389d1c6..a4830bc2 100644 --- a/docs/.vitepress/config/zh_TW.ts +++ b/docs/.vitepress/config/zh_TW.ts @@ -29,6 +29,7 @@ export const zhTWConfig: LocaleSpecificConfig = { text: '開發', collapsed: false, items: [ + { text: '開發容器', link: '/zh_TW/guide/devcontainer' }, { text: '構建', link: '/zh_TW/guide/build' }, { text: '專案結構', link: '/zh_TW/guide/project-structure' }, { text: '配置模板', link: '/zh_TW/guide/nginx-ui-template' }, diff --git a/docs/guide/devcontainer.md b/docs/guide/devcontainer.md new file mode 100644 index 00000000..0f21c6c0 --- /dev/null +++ b/docs/guide/devcontainer.md @@ -0,0 +1,50 @@ +# Devcontainer + +You'll need to set up a development environment if you want to develop on this project. + +## Prerequisites + +- Docker +- VSCode (Cursor) +- Git + +## Setup + +1. Open the Command Palette in VSCode (Cursor) + - Mac: `Cmd`+`Shift`+`P` + - Windows: `Ctrl`+`Shift`+`P` +2. Search for `Dev Containers: Rebuild and Reopen in Container` and click on it +3. Wait for the container to start +4. Open the Command Palette in VSCode (Cursor) + - Mac: `Cmd`+`Shift`+`P` + - Windows: `Ctrl`+`Shift`+`P` +5. Select Tasks: Run Task -> Start all services +6. Wait for the services to start + +## Ports + +| Port | Service | +|-------|------------------| +| 3002 | App | +| 3003 | Documentation | +| 9000 | API Backend | + + +## Services + +- nginx-ui +- nginx-ui-2 +- casdoor +- chaltestsrv +- pebble + +## Multi-node development + +Add the following enviroment in the main node: + +``` +name: nginx-ui-2 +url: http://nginx-ui-2 +token: nginx-ui-2 +``` + diff --git a/docs/zh_CN/guide/devcontainer.md b/docs/zh_CN/guide/devcontainer.md new file mode 100644 index 00000000..c1dc5762 --- /dev/null +++ b/docs/zh_CN/guide/devcontainer.md @@ -0,0 +1,48 @@ +# 开发容器 + +如果您想参与本项目开发,需要设置开发环境。 + +## 前提条件 + +- Docker +- VSCode (Cursor) +- Git + +## 设置步骤 + +1. 在 VSCode (Cursor) 中打开命令面板 + - Mac: `Cmd`+`Shift`+`P` + - Windows: `Ctrl`+`Shift`+`P` +2. 搜索 `Dev Containers: 重新生成并重新打开容器` 并点击 +3. 等待容器启动 +4. 再次打开命令面板 + - Mac: `Cmd`+`Shift`+`P` + - Windows: `Ctrl`+`Shift`+`P` +5. 选择 任务: 运行任务 -> 启动所有服务 +6. 等待所有服务启动完成 + +## 端口映射 + +| 端口 | 服务 | +|-------|-------------------| +| 3002 | 主应用 | +| 3003 | 文档 | +| 9000 | API 后端 | + +## 服务列表 + +- nginx-ui +- nginx-ui-2 +- casdoor +- chaltestsrv +- pebble + +## 多节点开发 + +在主节点中添加以下环境配置: + +``` +name: nginx-ui-2 +url: http://nginx-ui-2 +token: nginx-ui-2 +``` diff --git a/docs/zh_TW/guide/devcontainer.md b/docs/zh_TW/guide/devcontainer.md new file mode 100644 index 00000000..f7b32d51 --- /dev/null +++ b/docs/zh_TW/guide/devcontainer.md @@ -0,0 +1,48 @@ +# 開發容器 + +如果您想參與本專案開發,需要設定開發環境。 + +## 必要條件 + +- Docker +- VSCode (Cursor) +- Git + +## 設定步驟 + +1. 在 VSCode (Cursor) 中開啟指令面板 + - Mac: `Cmd`+`Shift`+`P` + - Windows: `Ctrl`+`Shift`+`P` +2. 搜尋 `Dev Containers: 重新產生並重新開啟容器` 並點擊 +3. 等待容器啟動 +4. 再次開啟指令面板 + - Mac: `Cmd`+`Shift`+`P` + - Windows: `Ctrl`+`Shift`+`P` +5. 選擇 任務: 執行任務 -> 啟動所有服務 +6. 等待所有服務啟動完成 + +## 連接埠映射 + +| 連接埠 | 服務 | +|-------|-------------------| +| 3002 | 主應用 | +| 3003 | 文件 | +| 9000 | API 後端 | + +## 服務清單 + +- nginx-ui +- nginx-ui-2 +- casdoor +- chaltestsrv +- pebble + +## 多節點開發 + +在主節點中新增以下環境設定: + +``` +name: nginx-ui-2 +url: http://nginx-ui-2 +token: nginx-ui-2 +```