version: "3.8"

services:
  wizarr:
    container_name: wizarr
    image: ghcr.io/wizarrrr/wizarr:2.2.0
    ports:
      - ${APP_PORT}:5690
    volumes:
      - ${APP_DATA_DIR}/data/database:/data/database
    environment:
      - APP_URL=${APP_PROTOCOL:-http}://${APP_DOMAIN}
      - DISABLE_BUILTIN_AUTH=false #Set to true ONLY if you are using another auth provider (Authelia, Authentik, etc)
      - TZ=${TZ}
    networks:
      - tipi_main_network
    labels:
      # Main
      traefik.enable: true
      traefik.http.middlewares.wizarr-web-redirect.redirectscheme.scheme: https
      traefik.http.services.wizarr.loadbalancer.server.port: 5690
      # Web
      traefik.http.routers.wizarr-insecure.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.wizarr-insecure.entrypoints: web
      traefik.http.routers.wizarr-insecure.service: wizarr
      traefik.http.routers.wizarr-insecure.middlewares: wizarr-web-redirect
      # Websecure
      traefik.http.routers.wizarr.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.wizarr.entrypoints: websecure
      traefik.http.routers.wizarr.service: wizarr
      traefik.http.routers.wizarr.tls.certresolver: myresolver
      # Local domain
      traefik.http.routers.wizarr-local-insecure.rule: Host(`wizarr.${LOCAL_DOMAIN}`)
      traefik.http.routers.wizarr-local-insecure.entrypoints: web
      traefik.http.routers.wizarr-local-insecure.service: wizarr
      traefik.http.routers.wizarr-local-insecure.middlewares: wizarr-web-redirect
      # Local domain secure
      traefik.http.routers.wizarr-local.rule: Host(`wizarr.${LOCAL_DOMAIN}`)
      traefik.http.routers.wizarr-local.entrypoints: websecure
      traefik.http.routers.wizarr-local.service: wizarr
      traefik.http.routers.wizarr-local.tls: true