services:
  slskd:
    extends:
      file: ${TEMPLATES_PATH}
      service: default
    image: slskd/slskd:0.24.4
    container_name: slskd
    user: ${PUID}:${PGID}
    ports:
      - 2013:5031 # http
      - 2014:5030 # https
      - 50300:50300 # incoming connections
    networks:
      - ip4net
    environment:
      - SLSKD_REMOTE_CONFIGURATION=true
    volumes:
      - ${MEDIA_PATH}/slskd/config/slskd.yml:/app/slskd.yml
      - ${MEDIA_PATH}/data/slskd_downloads:/app/downloads
      - ${EXTERNAL_STORAGE}/media/music:/app/library
    labels:
      # Traefik
      - "traefik.enable=true"
      - "traefik.http.routers.slskd.rule=Host(`slskd.${LOCAL_DOMAIN}`)"
      - "traefik.http.routers.slskd.entrypoints=https"
      - "traefik.http.routers.slskd.tls=true"
      - "traefik.http.services.slskd.loadbalancer.server.port=5030"
