> 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/vi/bao-tri/docker-compose.yml-to-toolkit-migration.md).

# Di chuyển từ docker-compose.yml sang Bộ công cụ

Nếu hiện tại bạn đang sử dụng Docker Compose thông qua một `docker-compose.yml` tệp, việc chuyển sang Toolkit có thể giúp việc triển khai, nâng cấp và bảo trì một phiên bản Overleaf cài đặt tại chỗ dễ dàng hơn.

Để di chuyển, bạn sẽ cần chuyển thiết lập Docker Compose hiện có của mình sang định dạng được Toolkit sử dụng. Quá trình này bao gồm việc sao chép cấu hình hiện có vào Toolkit.

Hướng dẫn này sẽ dẫn bạn qua từng bước của quá trình này, đảm bảo việc chuyển đổi từ Docker Compose sang Toolkit diễn ra suôn sẻ.

{% hint style="info" %}
Các hướng dẫn này dành cho v4.x và các phiên bản trước. Vì vậy, tất cả các biến sử dụng `SHARELATEX_` tiền tố thay vì `OVERLEAF_`.
{% endhint %}

{% stepper %}
{% step %}

### Clone kho lưu trữ Toolkit

Trước tiên, hãy clone kho lưu trữ Toolkit về máy chủ host:

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

Tiếp theo, chạy `bin/init` lệnh để khởi tạo Toolkit với cấu hình mặc định của nó.
{% endstep %}

{% step %}

### Thiết lập image và phiên bản

Trong một `docker-compose.yml` image và phiên bản được định nghĩa trong phần mô tả thành phần, ví dụ:

```yaml
version: '2.2'
services:
    sharelatex:
        restart: always
        # Dành cho người dùng Server Pro:
        # image: quay.io/sharelatex/sharelatex-pro
        image: sharelatex/sharelatex:3.5.13
```

Khi sử dụng Toolkit, tên image sẽ được tự động xác định; yêu cầu duy nhất là đặt `SERVER_PRO=true` trong **config/overleaf.rc** để chọn image Server Pro hoặc `SERVER_PRO=false` để sử dụng Community Edition.

Số phiên bản mong muốn của Server Pro/Community Edition được đặt trong **config/version** tệp. Toolkit yêu cầu một số phiên bản cụ thể như `4.2.3`. Nếu bạn đang sử dụng `mới nhất`, bạn có thể dùng `bin/images` để tìm image id của phiên bản cục bộ `mới nhất` phiên bản, sau đó dùng ghi chú phát hành cho 2.x.x, 3.x.x, 4.x.x hoặc 5.x.x để ánh xạ image id sang phiên bản.

Nếu bạn lấy image từ registry nội bộ của riêng mình, bạn có thể ghi đè image mà Toolkit sử dụng bằng cách đặt `OVERLEAF_IMAGE_NAME`. Bạn không cần chỉ định tag vì Toolkit sẽ tự động thêm nó dựa trên **config/version** tệp.
{% endstep %}

{% step %}

### Cấu hình truy cập bên ngoài

Theo mặc định, Overleaf sẽ lắng nghe trên `127.0.0.1:80`, chỉ cho phép lưu lượng từ máy chủ Docker.

Để cho phép truy cập bên ngoài, hãy đặt `OVERLEAF_LISTEN_IP` và `OVERLEAF_PORT` trong [**config/overleaf.rc**](/on-premises/vi/cau-hinh/overleaf-toolkit/environment-variables.md) tệp.
{% endstep %}

{% step %}

### Di chuyển các biến môi trường

Có lẽ bạn sẽ có một tập hợp các biến môi trường được định nghĩa trong `sharelatex` dịch vụ trong tệp `docker-compose.yml`, ví dụ:

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

Sao chép các biến này vào [**config/variables.env**](broken://pages/556eaeb4dddcb30f8e61eab36f50573c660f1752) tệp của Toolkit, đảm bảo theo dạng sau (dùng `=` thay vì `:`):

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

Các ngoại lệ / khác biệt khi sử dụng Toolkit:

* Các biến bắt đầu bằng `SANDBOXED_COMPILES_` và `DOCKER_RUNNER` không còn cần nữa. Để bật Sandboxed Compiles, đặt `SIBLING_CONTAINERS_ENABLED=true` trong tệp **config/overleaf.rc** tệp.
* Các biến bắt đầu bằng `OVERLEAF_MONGO_`, `OVERLEAF_REDIS_` và `REDIS_HOST` biến không còn cần nữa. MongoDB và Redis hiện được cấu hình trong **config/overleaf.rc** tệp bằng cách sử dụng `MONGO_URL`, `REDIS_HOST` và `REDIS_PORT`.

Đối với các tùy chọn cấu hình nâng cao, hãy tham khảo [config/overleaf.rc](/on-premises/vi/cau-hinh/overleaf-toolkit/environment-variables.md) tài liệu.
{% endstep %}

{% step %}

### Proxy NGINX

Để biết hướng dẫn cách di chuyển `nginx`, xem [tài liệu TLS Proxy](/on-premises/vi/cau-hinh/overleaf-toolkit/tls-proxy.md):
{% endstep %}

{% step %}

### Các volume

Đặt vị trí của các volume dữ liệu trong **config/overleaf.rc**:

#### ShareLaTeX

Đặt `OVERLEAF_DATA_PATH` thành vị trí của volume dữ liệu được sử dụng bởi `sharelatex` container.

#### MongoDB

Đặt `MONGO_DATA_PATH` thành vị trí của volume dữ liệu được sử dụng bởi `mongo` container.

#### Redis

Đặt `REDIS_DATA_PATH` thành vị trí của volume dữ liệu được sử dụng bởi `redis` container.
{% endstep %}
{% endstepper %}

Để biết thêm chi tiết và cấu hình nâng cao, tham khảo các tài liệu cấu hình Toolkit liên quan được liên kết ở trên.


---

# 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/vi/bao-tri/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.
