version: "2.1"

services:
  syncthing:
    image: linuxserver/syncthing
    networks:
      - traefik
    container_name: syncthing
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Copenhagen
      - UMASK_SET=022
    volumes:
      - /srv/syncthing:/config
      - nfs_data:/data1
    ports:
      - 8384:8384
      - 22000:22000
      - 21027:21027
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.syncthing.entrypoints=websecure"
      - "traefik.http.routers.syncthing.rule=Host(`syncthing.$DOMAIN_NAME`)"
      - "traefik.http.routers.syncthing.tls.certresolver=letsencr"
      - "traefik.http.services.syncthing.loadbalancer.server.port=8384"
    restart: unless-stopped

volumes:
  nfs_data:
    external: true

networks:
  traefik:
    external: true