From 2e76e5ea1fc38a9824ef67650edea24b062d3a99 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:20:28 +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=E5=92=8C=20.gitignore=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stacks/sything/.gitignore | 1 + stacks/sything/docker-compose.yml | 49 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 stacks/sything/.gitignore create mode 100644 stacks/sything/docker-compose.yml diff --git a/stacks/sything/.gitignore b/stacks/sything/.gitignore new file mode 100644 index 0000000..52b2e10 --- /dev/null +++ b/stacks/sything/.gitignore @@ -0,0 +1 @@ +st-sync-* \ No newline at end of file diff --git a/stacks/sything/docker-compose.yml b/stacks/sything/docker-compose.yml new file mode 100644 index 0000000..3ff28e5 --- /dev/null +++ b/stacks/sything/docker-compose.yml @@ -0,0 +1,49 @@ +--- +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 + restart: unless-stopped + syncthing-2: + depends_on: + syncthing-1: + condition: service_healthy + <<: *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