From 6b18d3acc206b1123d121ff3323ede3a0c543ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= <37316281+yanhao98@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:44:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20syncthing=20=E7=9A=84=20Do?= =?UTF-8?q?cker=20Compose=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E4=B8=A4=E4=B8=AA=E6=9C=8D=E5=8A=A1=E5=8F=8A?= =?UTF-8?q?=E5=85=B6=E4=BE=9D=E8=B5=96=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stacks/sything/docker-compose-pwd.yml | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 stacks/sything/docker-compose-pwd.yml diff --git a/stacks/sything/docker-compose-pwd.yml b/stacks/sything/docker-compose-pwd.yml new file mode 100644 index 0000000..a7c6eef --- /dev/null +++ b/stacks/sything/docker-compose-pwd.yml @@ -0,0 +1,50 @@ +--- +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: + - /root/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 + restart: unless-stopped + syncthing-2: + depends_on: + # syncthing-1: + # condition: service_healthy # v3 版本中已经被移除,只能通过一些额外的健康检查工具或者脚本来实现类似效果。 + - syncthing-1 + <<: *common-configuration + hostname: my-syncthing-2 + volumes: + - /root/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