captainVersion: 4
services:
    $$cap_appname:
        image: linuxserver/sonarr:$$cap_sonarr_version
        environment:
            TZ: $$cap_tz
            PUID: $$cap_puid
            PGID: $$cap_guid
        hostname: $$cap_appname.$$cap_root_domain
        volumes:
            - $$cap_appname-config:/config
            - $$cap_path_to_tv:/tv
            - $$cap_path_to_downloads:/downloads
        caproverExtra:
            containerHttpPort: 8989
caproverOneClickApp:
    variables:
        - id: $$cap_sonarr_version
          label: Sonarr Version
          defaultValue: preview
          description: Check out their Docker page for the valid tags https://hub.docker.com/r/linuxserver/sonarr/tags
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_tz
          label: Time Zone
          defaultValue: Europe/Brussels
          description: Get yours from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
          validRegex: /.{1,}/
        - id: $$cap_path_to_downloads
          label: Location of download managers output directory
          description: Location of download managers output directory
          validRegex: /\/[^\s-][a-zA-Z0-9_\/-]*[^\/][^\s-]/
        - id: $$cap_path_to_tv
          label: Location of TV library on disk
          description: Location of TV library on disk
          validRegex: /\/[^\s-][a-zA-Z0-9_\/-]*[^\/][^\s-]/
        - id: $$cap_puid
          label: User ID
          defaultValue: '1000'
          description: User ID that the process uses, run (id $user) in your instance to see the id
          validRegex: /.{1,}/
        - id: $$cap_guid
          label: Group ID
          defaultValue: '1000'
          description: Group ID that the process uses, run (id $user) in your instance to see the id
          validRegex: /.{1,}/
    instructions:
        start: >-
            Sonarr (formerly NZBdrone) is a PVR for usenet and bittorrent users.

            It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them.

            It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.
        end: >-
            Sonarr is deployed and available as $$cap_appname.
    displayName: Sonarr
    isOfficial: true
    description: Sonarr (formerly NZBdrone) is a PVR for usenet and bittorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them.
    documentation: Taken from https://hub.docker.com/r/linuxserver/sonarr.
