version: "3"
services:
  btcpayserver:
    environment:
      BTCPAY_EXTERNALSERVICES: "Sphinx Relay:${BTCPAY_PROTOCOL:-https}://${BTCPAY_HOST}/sphinxrelay/app;"
    volumes:
      - "sphinxrelay_datadir:/etc/sphinxrelay_datadir"
  sphinxrelay:
    image: "sphinxlightning/sphinx-relay:v2.2.9"
    user: "0:0"
    restart: unless-stopped
    expose:
      - "3300"
    volumes:
      - "sphinxrelay_datadir:/relay/.lnd"
      - "lnd_bitcoin_datadir:/relay/lnd:ro"
    environment:
      NODE_ENV: production
      NODE_IP: ${BTCPAY_HOST}/sphinxrelay
      NODE_ALIAS: ${LIGHTNING_ALIAS}
      LND_IP: lnd_bitcoin
      LND_PORT: 10009
      PORT: 3300
      MACAROON_LOCATION: /relay/lnd/admin.macaroon
      ROUTER_MACAROON_LOCATION: /relay/lnd/data/chain/bitcoin/mainnet/router.macaroon
      SIGNER_MACAROON_LOCATION: /relay/lnd/data/chain/bitcoin/mainnet/signer.macaroon
      TLS_LOCATION: /relay/lnd/tls.cert
      LND_LOG_LOCATION: /relay/lnd/logs/bitcoin/mainnet/lnd.log
      PUBLIC_URL: ${BTCPAY_PROTOCOL:-https}://${BTCPAY_HOST}/sphinxrelay/
    links:
      - lnd_bitcoin
volumes:
  sphinxrelay_datadir:
required:
  - "bitcoin-lnd"
  - "opt-lnd-grpc"
  - "opt-lnd-keysend"
