Hey! Really impressed with Traefik - what a solid bit of software.
I'm running several docker services all behaving well behind the proxy. The one I'm having an issue with though is syncthing. I'd like to expose its admin interface behind Traefik but have the following issue:
- I need to run syncthing with
network_mode: host
since I would like other devices on the LAN to connect to it directly rather than routing through the WAN first. - This means that Traefik sees the server IP address as
http://127.0.0.1:8384
which obviously won't work. - I tried adding the label
traefik.http.services.syncthing.loadbalancer.server.url=http://192....:8384"
, but that doesn't seem to have an effect, possibly because I also have the labeltraefik.http.services.syncthing.loadbalancer.server.port
set. - If I remove
traefik.http.services.syncthing.loadbalancer.server.port
, then Traefik will complain about the lack of port for this service:
ERR github.com/traefik/traefik/v3/pkg/provider/docker/config.go:82 > error="service \"syncthing\" error: port is missing" container=syncthing-syncthing-ca4af5c41072f81851caa2a7b0451fb5819221f76086c90ff46e01b99a5ddf34 providerName=docker
Any tips?
services:
syncthing:
image: lscr.io/linuxserver/syncthing:latest
container_name: syncthing
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- SNIPPED
restart: unless-stopped
network_mode: host
labels:
- "traefik.enable=true"
- "traefik.http.routers.syncthing.rule=Host(`syncthing.home.lan`)"
- "traefik.http.services.syncthing.loadbalancer.server.url=http://192.....:8384"
- "traefik.http.services.syncthing.loadbalancer.server.port=8384"