---
version: "2.1"
services:
  deluge:
    image: lscr.io/linuxserver/deluge:latest
    container_name: deluge
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - DELUGE_LOGLEVEL=error #optional
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.deluge.rule=Host(`${DOMAINNAME}`)"
      - "traefik.http.routers.deluge.entrypoints=websecure"
      - "traefik.http.routers.deluge.tls=true"
      - "traefik.http.routers.deluge.tls.certresolver=myresolver"
      - "traefik.http.services.deluge.loadbalancer.server.port=8112"
    volumes:
      - /opt/deluge/config:/config
      - /opt/deluge/downloads:/downloads
    ports:
      - 8112:8112
      - 6881:6881
      - 6881:6881/udp
    restart: unless-stopped