version: "3"
services:
  btcpayserver:
    environment:
      BTCPAY_BTCEXTERNALTHUNDERHUB: "server=/thub/sso;cookiefile=/etc/lnd_bitcoin_thub_datadir/.cookie"
    volumes:
      - "lnd_bitcoin_thub_datadir:/etc/lnd_bitcoin_thub_datadir"
  bitcoin_thub:
    image: apotdevin/thunderhub:base-v0.13.23@sha256:8385a4b176b9fdd6aee56a1ba23c0c582d399f8d8b0df4350fd245bac127a436
    restart: unless-stopped
    stop_signal: SIGKILL
    environment:
      NO_VERSION_CHECK: "true"
      COOKIE_PATH: "/data/.cookie"
      ACCOUNT_CONFIG_PATH: "/data/thubConfig.yaml"
      SSO_SERVER_URL: "lnd_bitcoin:10009"
      SSO_MACAROON_PATH: "/etc/lnd"
      SSO_CERT_PATH: "/etc/lnd/tls.cert"
      NO_CLIENT_ACCOUNTS: "true"
      LOG_LEVEL: debug
      LOGOUT_URL: "/server/services/thunderhub/BTC"
    labels:
      traefik.enable: "true"
      traefik.http.routers.bitcoin_thub.rule: Host(`${BTCPAY_HOST}`) && (Path(`/thub`) || PathPrefix(`/thub/`))
    volumes:
      - "lnd_bitcoin_datadir:/etc/lnd"
      - "lnd_bitcoin_thub_datadir:/data"
    expose:
      - "3000"
    links:
      - lnd_bitcoin
volumes:
  lnd_bitcoin_thub_datadir:
required:
  - "bitcoin-lnd"
