version: "3.8"

services:
  wizarr:
    container_name: wizarr
    image: ghcr.io/wizarrrr/wizarr:3.5.1
    ports:
      - ${APP_PORT}:5690
    volumes:
      - ${APP_DATA_DIR}/data/database:/data/database
    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
