version: "3.3"

services:
  mind:
    container_name: mind
    image: mrcas/mind:v1.4.0
    volumes:
      - ${APP_DATA_DIR}/data/mind-db:/app/db
    environment:
      - TZ=${TZ}
    ports:
      - ${APP_PORT}:8080
    networks:
      - tipi_main_network
    labels:
      # Main
      traefik.enable: true
      traefik.http.middlewares.mind-web-redirect.redirectscheme.scheme: https
      traefik.http.services.mind.loadbalancer.server.port: 8080
      # Web
      traefik.http.routers.mind-insecure.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.mind-insecure.entrypoints: web
      traefik.http.routers.mind-insecure.service: mind
      traefik.http.routers.mind-insecure.middlewares: mind-web-redirect
      # Websecure
      traefik.http.routers.mind.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.mind.entrypoints: websecure
      traefik.http.routers.mind.service: mind
      traefik.http.routers.mind.tls.certresolver: myresolver
      # Local domain
      traefik.http.routers.mind-local-insecure.rule: Host(`mind.${LOCAL_DOMAIN}`)
      traefik.http.routers.mind-local-insecure.entrypoints: web
      traefik.http.routers.mind-local-insecure.service: mind
      traefik.http.routers.mind-local-insecure.middlewares: mind-web-redirect
      # Local domain secure
      traefik.http.routers.mind-local.rule: Host(`mind.${LOCAL_DOMAIN}`)
      traefik.http.routers.mind-local.entrypoints: websecure
      traefik.http.routers.mind-local.service: mind
      traefik.http.routers.mind-local.tls: true
