version: "3"

services:
  dashy:
    container_name: dashy
    image: ghcr.io/lissy93/dashy:2.1.2
    ports:
      - ${APP_PORT}:80
    volumes:
      - ${APP_DATA_DIR}/data/dashy/conf.yml:/app/public/conf.yml
    restart: unless-stopped
    networks:
      - tipi_main_network
    labels:
      # Main
      traefik.enable: true
      traefik.http.middlewares.dashy-web-redirect.redirectscheme.scheme: https
      traefik.http.services.dashy.loadbalancer.server.port: 80
      # Web
      traefik.http.routers.dashy-insecure.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.dashy-insecure.entrypoints: web
      traefik.http.routers.dashy-insecure.service: dashy
      traefik.http.routers.dashy-insecure.middlewares: dashy-web-redirect
      # Websecure
      traefik.http.routers.dashy.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.dashy.entrypoints: websecure
      traefik.http.routers.dashy.service: dashy
      traefik.http.routers.dashy.tls.certresolver: myresolver
      # Local domain
      traefik.http.routers.dashy-local-insecure.rule: Host(`dashy.${LOCAL_DOMAIN}`)
      traefik.http.routers.dashy-local-insecure.entrypoints: web
      traefik.http.routers.dashy-local-insecure.service: dashy
      traefik.http.routers.dashy-local-insecure.middlewares: dashy-web-redirect
      # Local domain secure
      traefik.http.routers.dashy-local.rule: Host(`dashy.${LOCAL_DOMAIN}`)
      traefik.http.routers.dashy-local.entrypoints: websecure
      traefik.http.routers.dashy-local.service: dashy
      traefik.http.routers.dashy-local.tls: true