syncthing是比较好用的异地文件同步工具,默认使用全球发现服务器。如果已经实现了异地组网,可以自建发现服务器和中继服务器:
services:
# 自建syncthing的发现服务器 syncthing-discovery-server
syncthing_discovery_server:
image: syncthing/discosrv
container_name: syncthing-discovery-server
command: --debug --listen=":8443" --db-dir="."
environment:
- PUID=1000
- PGID=1000
volumes:
- ./discosrv:/var/stdiscosrv
ports:
- 8443:8443 # Listen address (default “:8443”)
restart: always
# 自建syncthing的中继服务器 syncthing-relay-server
syncthing_relay_server:
image: syncthing/relaysrv:latest
container_name: syncthing-relay-server
command: -debug -pools="" -listen=":22067"
environment:
- PUID=1000
- PGID=1000
volumes:
- ./relaysrv:/var/strelaysrv
ports:
- 22067:22067 # 中继服务器的数据连接端口(必须开启)
#- 22070:22070 # 用于公用的中继服务器池,显示数据传输、客户端数量等状态,可不开启
restart: always

