version: '3.9'
services:
  octobot:
    container_name: octobot
    image: drakkarsoftware/octobot:1.0.10
    environment:
      - TZ=${TZ}
    volumes:
      - ${APP_DATA_DIR}/data/user:/octobot/user
      - ${APP_DATA_DIR}/data/tentacles:/octobot/tentacles
      - ${APP_DATA_DIR}/data/logs:/octobot/logs
    ports:
      - ${APP_PORT}:5001
    restart: unless-stopped
    networks:
      - tipi_main_network
    dns:
      - ${DNS_IP}
    labels:
      # Main
      traefik.enable: true
      traefik.http.middlewares.octobot-web-redirect.redirectscheme.scheme: https
      traefik.http.services.octobot.loadbalancer.server.port: 5001
      # Web
      traefik.http.routers.octobot-insecure.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.octobot-insecure.entrypoints: web
      traefik.http.routers.octobot-insecure.service: octobot
      traefik.http.routers.octobot-insecure.middlewares: octobot-web-redirect
      # Websecure
      traefik.http.routers.octobot.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.octobot.entrypoints: websecure
      traefik.http.routers.octobot.service: octobot
      traefik.http.routers.octobot.tls.certresolver: myresolver
      # Local domain
      traefik.http.routers.octobot-local-insecure.rule: Host(`octobot.${LOCAL_DOMAIN}`)
      traefik.http.routers.octobot-local-insecure.entrypoints: web
      traefik.http.routers.octobot-local-insecure.service: octobot
      traefik.http.routers.octobot-local-insecure.middlewares: octobot-web-redirect
      # Local domain secure
      traefik.http.routers.octobot-local.rule: Host(`octobot.${LOCAL_DOMAIN}`)
      traefik.http.routers.octobot-local.entrypoints: websecure
      traefik.http.routers.octobot-local.service: octobot
      traefik.http.routers.octobot-local.tls: true