diff --git a/stacks/syncthing/.gitignore b/stacks/syncthing/.gitignore deleted file mode 100644 index 52b2e10..0000000 --- a/stacks/syncthing/.gitignore +++ /dev/null @@ -1 +0,0 @@ -st-sync-* \ No newline at end of file diff --git a/stacks/syncthing/README.md b/stacks/syncthing/README.md deleted file mode 100644 index dc7280d..0000000 --- a/stacks/syncthing/README.md +++ /dev/null @@ -1,33 +0,0 @@ -****# sything -[![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](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 - -TARGET1="/host$SOURCE1" -docker run -d --restart unless-stopped --name syncthing \ - -h $HOSTNAME \ - --mount type=bind,source=$SOURCE1,target=$TARGET1 \ - --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 - -echo -e "\n Folder ID: $HOSTNAME$SOURCE1 \nFolder Path: $TARGET1 \n----- \n/host/root/st-folder/$HOSTNAME(change-it)/root/_docker-stacks" -``` - -- 访问`https://服务器ip:28198` -- 设置用户名密码 -- 添加文件夹: 文件夹路径固定填`/host$SOURCE1` - -```bash -docker exec -it syncthing find /host -maxdepth 3 - -tree /root/st-folder -L 3 -find /root/st-folder -maxdepth 3 -``` \ No newline at end of file diff --git a/stacks/syncthing/docker-compose-pwd.yml b/stacks/syncthing/docker-compose-pwd.yml deleted file mode 100644 index 8758d18..0000000 --- a/stacks/syncthing/docker-compose-pwd.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: st -x-common-configuration: &common-configuration - image: syncthing/syncthing - environment: - - TZ=Asia/Shanghai - - PUID=0 - - PGID=0 - restart: unless-stopped - healthcheck: - test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1 - interval: 10s - timeout: 5s - retries: 3 -services: - syncthing-1: - deploy: - replicas: 1 - <<: *common-configuration - hostname: my-syncthing-1 - volumes: - - /root/st-sync-1-folder:/st-folder - - /root/st-sync-1-cfg:/var/syncthing/config - ports: - - 28001:8384 - syncthing-2: - deploy: - replicas: 1 - depends_on: - - syncthing-1 - <<: *common-configuration - hostname: my-syncthing-2 - volumes: - - /root/st-sync-2-folder:/st-folder - - /root/st-sync-2-cfg:/var/syncthing/config - ports: - - 28002:8384 \ No newline at end of file diff --git a/stacks/syncthing/docker-compose.yml b/stacks/syncthing/docker-compose.yml deleted file mode 100644 index b405497..0000000 --- a/stacks/syncthing/docker-compose.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: st -volumes: - st-sync-1-cfg: - st-sync-2-cfg: -x-common-configuration: &common-configuration - image: syncthing/syncthing - environment: - - TZ=Asia/Shanghai - - PUID=0 - - PGID=0 - restart: unless-stopped - healthcheck: - test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1 - # interval: 1m - # timeout: 10s - interval: 10s - timeout: 5s - retries: 3 -services: - syncthing-1: - <<: *common-configuration - hostname: my-syncthing-1 - volumes: - - ./st-sync-1-folder:/st-folder - - type: volume - source: st-sync-1-cfg - target: /var/syncthing/config - ports: - - 28001:8384 # Web UI - # - 22000:22000/tcp # TCP file transfers - # - 22000:22000/udp # QUIC file transfers - # - 21027:21027/udp # Receive local discovery broadcasts - syncthing-2: - depends_on: - # syncthing-1: - # condition: service_healthy # v3 版本中已经被移除,只能通过一些额外的健康检查工具或者脚本来实现类似效果。 - - syncthing-1 - <<: *common-configuration - hostname: my-syncthing-2 - volumes: - - ./st-sync-2-folder:/st-folder - - type: volume - source: st-sync-2-cfg - target: /var/syncthing/config - ports: - - 28002:8384 # Web UI - # - 22000:22000/tcp # TCP file transfers - # - 22000:22000/udp # QUIC file transfers - # - 21027:21027/udp # Receive local discovery broadcasts