mirror of
https://github.com/yanhao98/docker-example.git
synced 2025-07-12 23:50:49 +08:00
更新 README.md,添加 syncthing 使用示例和配置说明
This commit is contained in:
@ -2,4 +2,27 @@
|
||||
[](http://play-with-docker.com?stack=https://raw.githubusercontent.com/yanhao98/docker-example/refs/heads/main/stacks/sything/docker-compose-pwd.yml)
|
||||
```bash
|
||||
wget https://raw.githubusercontent.com/yanhao98/docker-example/refs/heads/main/stacks/sything/docker-compose.yml && docker-compose up -d
|
||||
```
|
||||
|
||||
## st-1
|
||||
```bash
|
||||
HOSTNAME=服务器主机名
|
||||
SOURCE1=/path/to/backup1
|
||||
|
||||
docker run -d --restart unless-stopped --name syncthing \
|
||||
-h $HOSTNAME \
|
||||
-v $SOURCE1:/host$SOURCE1 \
|
||||
--mount type=volume,source=st-sync-cfg,target=/var/syncthing/config \
|
||||
-e PUID=0 -e PGID=0 \
|
||||
-e TZ=Asia/Shanghai \
|
||||
-p 28198:8384 -p 22000:22000/tcp -p 22000:22000/udp -p 21027:21027/udp \
|
||||
syncthing/syncthing
|
||||
```
|
||||
|
||||
- 访问`https://服务器ip:28198`
|
||||
- 设置用户名密码
|
||||
- 添加文件夹: 文件夹路径固定填`/host`
|
||||
|
||||
```bash
|
||||
docker exec -it syncthing find /host -maxdepth 3
|
||||
```
|
Reference in New Issue
Block a user