> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/zh-tw/an-zhuang/air-gapped-offline-deployments.md).

# 隔離式／離線部署

一般而言，我們不建議在離線環境中部署 AyakaLeaf Pro，因為它的許多功能，例如 GitHub Sync 和 Zotero 整合，都需要網際網路連線。

但如果你想離線工作，這表示可能不一定總能連上 ghcr.io registry 以拉取所需的 `sharelatex` , `ayakaleaf-pro` 以及 TeX Live 映像。這不是問題，因為 Docker 提供了匯出與匯入映像的工具，可協助你進行離線／隔離網路部署。

從高層次來看，你會先在一台具備網際網路連線的裝置上下載所需的映像，將它們匯出到可攜式裝置（或透過 SCP/Rsync 傳輸），然後再匯入到隔離網路的伺服器上。

要做到這點，你需要完成以下步驟：

* 拉取所有所需的映像（ `overleaf-pro`, `git-bridge`, `mongo`, `redis` + 任何必要的 [TeX Live 映像](https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles#available-tex-live-images) 供 [Sandboxed Compiles](https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles)使用）在一台具有網際網路連線的機器上
  * `docker pull ghcr.io/ayaka-notes/overleaf-pro:6.1.2`
  * `docker pull quay.io/sharelatex/git-bridge:6.1.2` （標籤必須與以下相同： `overleaf-pro`)
  * `docker pull mongo:6` （請更改為實際版本）
  * `docker pull redis:6.2` （請更改為實際版本）
  * `docker pull ghcr.io/ayaka-notes/texlive-full:2024.1` （請更改為實際版本）
* 對於 **每個** 已拉取的映像，你接著需要將它們匯出為 .tar 檔。例如， `docker save ghcr.io/ayaka-notes/overleaf-pro:6.1.2 > overleaf-pro:6.1.2.tar`
* 使用你偏好的方法，將 `.tar` 檔案從你連上網際網路的機器傳輸到離線／隔離網路的伺服器
* 對於每個 .tar 檔案，使用 `docker load` 指令從 .tar 檔案載入映像。例如， `docker load < overleaf-pro:6.1.2.tar`
* 最後，執行 `docker images` 指令來查看／確認映像已成功載入，且它們可供使用

{% hint style="danger" %}
預設情況下，當你執行 `bin/up` 指令時，Toolkit 會嘗試自動拉取透過 `ALL_TEX_LIVE_DOCKER_IMAGES` 在 `config/variables.env`中設定的每個 TeX Live 映像。由於你的部署是隔離網路的，這會失敗——你可以透過使用 `SIBLING_CONTAINERS_PULL=false` 在 `config/overleaf.rc`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/zh-tw/an-zhuang/air-gapped-offline-deployments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
