Please check my compose for Syncthing? - Network doubt

Hello!

So im running my syncthing server from IO, using this file:

syncthing:

container_name: syncthing
restart: always
image: linuxserver/syncthing
volumes:
  - ${CONFIG}/syncthing:/config
  - ${DATA}/syncthing-data:/mnt/data
ports:
  - "8384:8384"
  - "22000:22000"
  - "21027:21027/udp"
environment:
  - PUID=${PUID}
  - PGID=${PGID}
  - UMASK_SET=002
  - TZ=${TZ}

IO guys never mentioned the local discovery issue by using docker standar network, i only find out when i looked at the description of the original image. Apparently automatic local discovery wont work by default, making transfers slow as they pass trough the relay servers. To fix this, you need to run the image with the option “network = host”, so the image connects directly to the host networks.

For this, the new compose would be:

syncthing:

container_name: syncthing
restart: always
image: linuxserver/syncthing
network_mode: host
volumes:
  - ${CONFIG}/syncthing:/config
  - ${DATA}/syncthing-data:/mnt/data
ports:
  - "8384:8384"
  - "22000:22000"
  - "21027:21027/udp"
environment:
  - PUID=${PUID}
  - PGID=${PGID}
  - UMASK_SET=002
  - TZ=${TZ}

So:

1.- Its this correct?

2.- I dont need to declare ports anymore right?

3.- This is safe?, somewhere i read that host network mode its unsafe, should i be worried?

THanks for the help!

Local discovery will not work because broadcast traffic (local discovery) is not routed between the docker network and the normal network. The ports are fine https://docs.syncthing.net/users/firewall.html. It seems a bug in Moby (former Docker) https://github.com/moby/moby/issues/17814.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.