{
	"ID": "20211226122459-08mi5cq",
	"Spec": "1",
	"Type": "NodeDocument",
	"Properties": {
		"id": "20211226122459-08mi5cq",
		"title": "Docker 伺服",
		"updated": "20231108220609"
	},
	"Children": [
		{
			"ID": "20220518213326-bk4p9a6",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20220518213326-bk4p9a6",
				"updated": "20220518213342"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "概述"
				}
			]
		},
		{
			"ID": "20220521230221-lttufyw",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20220521230221-lttufyw",
				"updated": "20220521230221"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "在服務器上伺服思源最簡單的方案是通過 Docker 部署。"
				}
			]
		},
		{
			"ID": "20220521230221-hwwahvr",
			"Type": "NodeList",
			"ListData": {},
			"Properties": {
				"id": "20220521230221-hwwahvr",
				"updated": "20220521230221"
			},
			"Children": [
				{
					"ID": "20220521230221-yeqkg58",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20220521230221-yeqkg58",
						"updated": "20220521230221"
					},
					"Children": [
						{
							"ID": "20220521230221-yulxs59",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20220521230221-yulxs59",
								"updated": "20220521230221"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "鏡像名稱 "
								},
								{
									"Type": "NodeTextMark",
									"TextMarkType": "code",
									"TextMarkTextContent": "b3log/siyuan"
								}
							]
						}
					]
				},
				{
					"ID": "20220521230221-vcehw0q",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20220521230221-vcehw0q",
						"updated": "20220521230221"
					},
					"Children": [
						{
							"ID": "20220521230221-k8vfzcf",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20220521230221-k8vfzcf",
								"updated": "20220521230221"
							},
							"Children": [
								{
									"Type": "NodeTextMark",
									"TextMarkType": "a",
									"TextMarkAHref": "https://hub.docker.com/r/b3log/siyuan",
									"TextMarkTextContent": "鏡像地址"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20211226122519-4ed44x8",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20211226122519-4ed44x8",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "文件結構"
				}
			]
		},
		{
			"ID": "20211226122519-kzprtsh",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20211226122519-kzprtsh",
				"updated": "20211228124513"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "整體程式位於 "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "/opt/siyuan/"
				},
				{
					"Type": "NodeText",
					"Data": " 下，基本上就是 Electron 安裝包 resources 文件夾下的結構："
				}
			]
		},
		{
			"ID": "20211226122519-dp4dv43",
			"Type": "NodeList",
			"ListData": {},
			"Properties": {
				"id": "20211226122519-dp4dv43",
				"updated": "20230630170719"
			},
			"Children": [
				{
					"ID": "20211226122519-sw50upp",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-sw50upp",
						"updated": "20211228132206"
					},
					"Children": [
						{
							"ID": "20211226122519-g4coowo",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-g4coowo",
								"updated": "20211228132206"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "appearance：圖示、主題、多語言"
								}
							]
						}
					]
				},
				{
					"ID": "20211226122519-1t88amn",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-1t88amn"
					},
					"Children": [
						{
							"ID": "20211226122519-51tle6l",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-51tle6l"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "guide：幫助文檔"
								}
							]
						}
					]
				},
				{
					"ID": "20211226122519-iewtwx8",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-iewtwx8",
						"updated": "20211228104843"
					},
					"Children": [
						{
							"ID": "20211226122519-fftnvkg",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-fftnvkg",
								"updated": "20211228104843"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "stage：界面和靜態資料"
								}
							]
						}
					]
				},
				{
					"ID": "20211226122519-sn8phpz",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-sn8phpz",
						"updated": "20230630170719"
					},
					"Children": [
						{
							"ID": "20211226122519-s5nun1r",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-s5nun1r",
								"updated": "20230630170719"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "kernel：核心程式"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20211226122519-kdp3vo5",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20211226122519-kdp3vo5",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "啟動入口"
				}
			]
		},
		{
			"ID": "20211226122519-ygn57k3",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20211226122519-ygn57k3",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "構建 Docker 鏡像時設置了入口："
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "ENTRYPOINT [ \"/opt/siyuan/kernel\" ]"
				},
				{
					"Type": "NodeText",
					"Data": "，使用 "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "docker run b3log/siyuan"
				},
				{
					"Type": "NodeText",
					"Data": " 並帶參即可啟動："
				}
			]
		},
		{
			"ID": "20211226122519-cpmotp6",
			"Type": "NodeList",
			"ListData": {},
			"Properties": {
				"id": "20211226122519-cpmotp6",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"ID": "20211226122519-l15oree",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-l15oree"
					},
					"Children": [
						{
							"ID": "20211226122519-0g8i8mj",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-0g8i8mj"
							},
							"Children": [
								{
									"Type": "NodeTextMark",
									"TextMarkType": "code",
									"TextMarkTextContent": "--workspace"
								},
								{
									"Type": "NodeText",
									"Data": " 指定工作空間文件夾路徑，在宿主機上通過 "
								},
								{
									"Type": "NodeTextMark",
									"TextMarkType": "code",
									"TextMarkTextContent": "-v"
								},
								{
									"Type": "NodeText",
									"Data": " 掛載到容器中"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20211226122519-ajimm1z",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20211226122519-ajimm1z",
				"updated": "20231108220606"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "更多的參數可參考"
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "block-ref",
					"TextMarkBlockRefID": "20211226122358-hctqcn5",
					"TextMarkBlockRefSubtype": "s",
					"TextMarkTextContent": "這裡"
				},
				{
					"Type": "NodeText",
					"Data": "。下面是一條啟動指令示例："
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "docker run -d -v workspace_dir_host:workspace_dir_container -p 6806:6806 b3log/siyuan --workspace=workspace_dir_container"
				},
				{
					"Type": "NodeText",
					"Data": "​"
				}
			]
		},
		{
			"ID": "20211226122519-5g8qw7j",
			"Type": "NodeList",
			"ListData": {},
			"Properties": {
				"id": "20211226122519-5g8qw7j",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"ID": "20211226122519-2t1ukwf",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-2t1ukwf"
					},
					"Children": [
						{
							"ID": "20211226122519-g8sxt5u",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-g8sxt5u"
							},
							"Children": [
								{
									"Type": "NodeTextMark",
									"TextMarkType": "code",
									"TextMarkTextContent": "workspace_dir_host"
								},
								{
									"Type": "NodeText",
									"Data": "：宿主機上的工作空間文件夾路徑"
								}
							]
						}
					]
				},
				{
					"ID": "20211226122519-kalelk8",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-kalelk8"
					},
					"Children": [
						{
							"ID": "20211226122519-75lsh4l",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-75lsh4l"
							},
							"Children": [
								{
									"Type": "NodeTextMark",
									"TextMarkType": "code",
									"TextMarkTextContent": "workspace_dir_container"
								},
								{
									"Type": "NodeText",
									"Data": "：容器內工作空間文件夾路徑，和後面 "
								},
								{
									"Type": "NodeTextMark",
									"TextMarkType": "code",
									"TextMarkTextContent": "--workspace"
								},
								{
									"Type": "NodeText",
									"Data": " 指定成一樣的"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20211226122519-yggdi08",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20211226122519-yggdi08",
				"updated": "20231108220609"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "為了簡化，建議將 workspace 文件夾路徑在宿主機和容器上配置為一致的，比如將 "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "workspace_dir_host"
				},
				{
					"Type": "NodeText",
					"Data": "​ 和 "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "workspace_dir_container"
				},
				{
					"Type": "NodeText",
					"Data": "​ 都配置為 "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "/siyuan/workspace"
				},
				{
					"Type": "NodeText",
					"Data": "​，對應的啟動指令示例："
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "docker run -d -v /siyuan/workspace:/siyuan/workspace -p 6806:6806 -u 1000:1000 b3log/siyuan --workspace=/siyuan/workspace/"
				},
				{
					"Type": "NodeText",
					"Data": "​。"
				}
			]
		},
		{
			"ID": "20211226122519-s9mfeas",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20211226122519-s9mfeas",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "用戶權限"
				}
			]
		},
		{
			"ID": "20211226122519-38pgtv3",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20211226122519-38pgtv3",
				"updated": "20211228132907"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "鏡像中是使用預設建立的普通用戶 "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "siyuan"
				},
				{
					"Type": "NodeText",
					"Data": "（uid 1000/gid 1000）來啟動kernel程式的，所以在宿主機建立工作空間文件夾時請註意設置該文件夾所屬用戶組："
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "chown -R 1000:1000 /siyuan/workspace"
				},
				{
					"Type": "NodeText",
					"Data": "，在啟動容器時需要帶參數 "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "-u 1000:1000"
				},
				{
					"Type": "NodeText",
					"Data": "。"
				}
			]
		},
		{
			"ID": "20211226122519-wwlpn5g",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20211226122519-wwlpn5g",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "隱藏埠"
				}
			]
		},
		{
			"ID": "20211226122519-akxtjeg",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20211226122519-akxtjeg",
				"updated": "20211226011647"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "使用 NGINX 反向代理可以隱藏 6806 埠，請註意："
				}
			]
		},
		{
			"ID": "20211226122519-kh6qira",
			"Type": "NodeList",
			"ListData": {},
			"Properties": {
				"id": "20211226122519-kh6qira",
				"updated": "20211228132828"
			},
			"Children": [
				{
					"ID": "20211226122519-orj98i7",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20211226122519-orj98i7",
						"updated": "20211228132828"
					},
					"Children": [
						{
							"ID": "20211226122519-pgqa7l6",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20211226122519-pgqa7l6",
								"updated": "20211228132828"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "配置 WebSocket 反代 "
								},
								{
									"Type": "NodeTextMark",
									"TextMarkType": "code",
									"TextMarkTextContent": "/ws"
								},
								{
									"Type": "NodeText",
									"Data": "​"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20230406105213-87fl7tu",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20230406105213-87fl7tu",
				"updated": "20230406105213"
			},
			"Children": [
				{
					"Type": "NodeTextMark",
					"TextMarkType": "tag",
					"TextMarkTextContent": "注意"
				},
				{
					"Type": "NodeText",
					"Data": "​"
				}
			]
		},
		{
			"ID": "20230406105213-bhjbz5l",
			"Type": "NodeList",
			"ListData": {},
			"Properties": {
				"id": "20230406105213-bhjbz5l",
				"updated": "20230406105250"
			},
			"Children": [
				{
					"ID": "20230406105213-9bsxoem",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20230406105213-9bsxoem",
						"updated": "20230406105213"
					},
					"Children": [
						{
							"ID": "20230406105213-q4aecyp",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20230406105213-q4aecyp",
								"updated": "20230406105213"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "請務必確認掛載卷的正確性，否則容器刪除後資料會丟失"
								}
							]
						}
					]
				},
				{
					"ID": "20230406105213-3hw3e6i",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20230406105213-3hw3e6i",
						"updated": "20230406105250"
					},
					"Children": [
						{
							"ID": "20230406105213-hy2wy2j",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20230406105213-hy2wy2j",
								"updated": "20230406105250"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "不要使用 URL 重寫進行重定向，否則鑑權可能會有問題，建議配置反向代理"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20230406105213-yoyn08w",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20230406105213-yoyn08w",
				"updated": "20230406105213"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "限制"
				}
			]
		},
		{
			"ID": "20230406105213-899tzed",
			"Type": "NodeList",
			"ListData": {},
			"Properties": {
				"id": "20230406105213-899tzed",
				"updated": "20230406105213"
			},
			"Children": [
				{
					"ID": "20230406105213-n1iq0nk",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20230406105213-n1iq0nk",
						"updated": "20230406105213"
					},
					"Children": [
						{
							"ID": "20230406105213-8dbq6l2",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20230406105213-8dbq6l2",
								"updated": "20230406105213"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "不支持桌面端和移動端應用連接，僅支持在瀏覽器上使用"
								}
							]
						}
					]
				},
				{
					"ID": "20230406105213-a8dt0r2",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20230406105213-a8dt0r2",
						"updated": "20230406105213"
					},
					"Children": [
						{
							"ID": "20230406105213-2dqmoo6",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20230406105213-2dqmoo6",
								"updated": "20230406105213"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "不支持導出 PDF、HTML 和 Word 格式"
								}
							]
						}
					]
				},
				{
					"ID": "20230406105213-7du7gyh",
					"Type": "NodeListItem",
					"ListData": {
						"BulletChar": 42,
						"Marker": "Kg=="
					},
					"Properties": {
						"id": "20230406105213-7du7gyh",
						"updated": "20230406105213"
					},
					"Children": [
						{
							"ID": "20230406105213-c9nvb8g",
							"Type": "NodeParagraph",
							"Properties": {
								"id": "20230406105213-c9nvb8g",
								"updated": "20230406105213"
							},
							"Children": [
								{
									"Type": "NodeText",
									"Data": "不支持導入 Markdown 文件"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20230406105209-10odb7t",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20230406105209-10odb7t"
			}
		}
	]
}