diff --git a/en/guide/installation.md b/en/guide/installation.md index 0901f50..85415b6 100644 --- a/en/guide/installation.md +++ b/en/guide/installation.md @@ -84,6 +84,38 @@ This section only introduces installation methods. Please read the [Quick Networ ::: + To separate the configuration file from the container, create a `conf` directory next to `docker-compose.yml` and save the EasyTier configuration file as `./conf/easytier.toml`: + + ::: details docker-compose.yml (start with configuration file) + + ```yaml [docker-compose.yml] + services: + easytier: + # Users in mainland China can use the DaoCloud mirror + # image: m.daocloud.io/docker.io/easytier/easytier:latest + image: easytier/easytier:latest + hostname: easytier + container_name: easytier + restart: unless-stopped + network_mode: host + cap_add: + - NET_ADMIN + - NET_RAW + environment: + - TZ=Asia/Shanghai + devices: + - /dev/net/tun:/dev/net/tun + volumes: + - /etc/machine-id:/etc/machine-id:ro + - ./conf:/config + command: > + -c /config/easytier.toml + ``` + + ::: + + After modifying `./conf/easytier.toml`, run `docker compose restart easytier` to reload the configuration. + *** 4. **One-Click Installation Script (Linux Only)** diff --git a/guide/installation.md b/guide/installation.md index a7d6b2c..ba7dabf 100644 --- a/guide/installation.md +++ b/guide/installation.md @@ -84,6 +84,38 @@ ::: + 如果希望将配置文件与容器分离,可以在 `docker-compose.yml` 同级目录创建 `conf` 目录,并将 EasyTier 配置文件保存为 `./conf/easytier.toml`: + + ::: details docker-compose.yml(使用配置文件启动) + + ```yaml [docker-compose.yml] + services: + easytier: + # 国内用户可以使用 daocloud.io 镜像 + # image: m.daocloud.io/docker.io/easytier/easytier:latest + image: easytier/easytier:latest + hostname: easytier + container_name: easytier + restart: unless-stopped + network_mode: host + cap_add: + - NET_ADMIN + - NET_RAW + environment: + - TZ=Asia/Shanghai + devices: + - /dev/net/tun:/dev/net/tun + volumes: + - /etc/machine-id:/etc/machine-id:ro + - ./conf:/config + command: > + -c /config/easytier.toml + ``` + + ::: + + 修改 `./conf/easytier.toml` 后,执行 `docker compose restart easytier` 重新加载配置。 + *** 4. **一键安装脚本(仅 Linux)**