docs(installation): add compose config file example (#281)

This commit is contained in:
fanyang
2026-05-05 20:04:16 +08:00
committed by GitHub
parent c13808e125
commit 73dba40fb2
2 changed files with 64 additions and 0 deletions
+32
View File
@@ -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)**
+32
View File
@@ -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)**