> 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/ja/mentenansu/docker-compose.yml-to-toolkit-migration.md).

# docker-compose.yml から Toolkit への移行

現在 Docker Compose をファイル経由で使用している場合、 `docker-compose.yml` Toolkit に移行すると、Overleaf のオンプレミス版のデプロイ、アップグレード、保守が容易になります。

移行するには、既存の Docker Compose のセットアップを Toolkit で使用される形式に変換する必要があります。このプロセスでは、既存の設定を Toolkit にコピーします。

このガイドでは、このプロセスの各手順を順を追って説明し、Docker Compose から Toolkit へのスムーズな移行を確実にします。

{% hint style="info" %}
これらの手順は v4.x 以前向けです。そのため、すべての変数は `SHARELATEX_` の代わりにプレフィックス `OVERLEAF_`.
{% endhint %}

{% stepper %}
{% step %}

### Toolkit リポジトリをクローンする

まず、Toolkit リポジトリをホストマシンにクローンします:

```bash
git clone https://github.com/overleaf/toolkit.git ./overleaf-toolkit
```

次に、 `bin/init` コマンドを実行して、Toolkit を既定の設定で初期化します。
{% endstep %}

{% step %}

### イメージとバージョンの設定

典型的な `docker-compose.yml` では、イメージとバージョンはコンポーネントの説明内で定義されます。たとえば:

```yaml
version: '2.2'
services:
    sharelatex:
        restart: always
        # Server Pro ユーザー:
        # image: quay.io/sharelatex/sharelatex-pro
        image: sharelatex/sharelatex:3.5.13
```

Toolkit を使用する場合、イメージ名は自動的に解決されます。必要なのは、 `SERVER_PRO=true` を **config/overleaf.rc** を設定して Server Pro イメージを選ぶか、または `SERVER_PRO=false` を設定して Community Edition を使用することだけです。

希望する Server Pro / Community Edition のバージョン番号は、 **config/version** ファイルで設定します。Toolkit には、次のような特定のバージョン番号が必要です。 `4.2.3`。もし `latest`を使用している場合は、 `bin/images` を使ってローカルの `latest` バージョンの image ID を見つけ、その後 2.x.x、3.x.x、4.x.x、または 5.x.x のリリースノートを使って image ID をバージョンに対応付けます。

独自の社内レジストリからイメージを取得している場合は、 `OVERLEAF_IMAGE_NAME`を設定することで、Toolkit が使用するイメージを上書きできます。タグは指定する必要はありません。Toolkit が自動的に、 **config/version** ファイル。
{% endstep %}

{% step %}

### 外部アクセスの設定

既定では、Overleaf は `127.0.0.1:80`で待ち受け、Docker ホストマシンからのトラフィックのみを許可します。

外部アクセスを許可するには、 `OVERLEAF_LISTEN_IP` および `OVERLEAF_PORT` の [**config/overleaf.rc**](/on-premises/ja/she-ding/overleaf-toolkit/environment-variables.md) ファイル。
{% endstep %}

{% step %}

### 環境変数の移行

おそらく、 `sharelatex` サービスに定義された環境変数のセットが、あなたの `docker-compose.yml`中にあるでしょう。たとえば:

```yaml
environment:
    OVERLEAF_APP_NAME: Overleaf Community Edition
    OVERLEAF_PROXY_LEARN: 'true'
    …
```

これらの変数を Toolkit の [**config/variables.env**](broken://pages/f551e336de5a86c3f4fe6bfa88c2b6919b241a94) ファイルにコピーし、次の形式になるようにしてください（ `=` の代わりに `:`):

```env
OVERLEAF_APP_NAME=Overleaf Community Edition
OVERLEAF_PROXY_LEARN=true
```

Toolkit を使用する際の例外 / 相違点:

* で始まる変数は `SANDBOXED_COMPILES_` および `DOCKER_RUNNER` は不要になりました。Sandboxed Compiles を有効にするには、 `SIBLING_CONTAINERS_ENABLED=true` の **config/overleaf.rc** ファイル。
* で始まる変数は `OVERLEAF_MONGO_`, `OVERLEAF_REDIS_` と `REDIS_HOST` 変数は不要になりました。MongoDB と Redis は現在、 **config/overleaf.rc** ファイルで `MONGO_URL`, `REDIS_HOST` および `REDIS_PORT`.

を使用して設定されています。高度な設定オプションについては、 [config/overleaf.rc](/on-premises/ja/she-ding/overleaf-toolkit/environment-variables.md) ドキュメントを参照してください。
{% endstep %}

{% step %}

### NGINX プロキシ

移行方法については `nginx`を参照してください。 [TLS プロキシのドキュメント](/on-premises/ja/she-ding/overleaf-toolkit/tls-proxy.md):
{% endstep %}

{% step %}

### ボリューム

のデータボリュームの場所を **config/overleaf.rc**:

#### ShareLaTeX

を `OVERLEAF_DATA_PATH` が使用するデータボリュームの場所に設定します `sharelatex` コンテナ内

#### MongoDB

を `MONGO_DATA_PATH` が使用するデータボリュームの場所に設定します `mongo` コンテナ内

#### Redis

を `REDIS_DATA_PATH` が使用するデータボリュームの場所に設定します `redis` コンテナ内
{% endstep %}
{% endstepper %}

詳細と高度な設定については、上記にリンクされている関連する Toolkit の設定ドキュメントを参照してください。


---

# 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/ja/mentenansu/docker-compose.yml-to-toolkit-migration.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.
