version: '2'

services:
  lnd:
    build: ./data-sources/lnd
    volumes:
      - shared:/home/lnd/.lnd/
      - ./data-sources/lnd/lnd.conf:/home/lnd/.lnd/lnd.conf
      - ./data-sources/bitcoind/bitcoin.conf:/home/lnd/.bitcoin/bitcoin.conf
    entrypoint: ["./start-lnd.sh"]
    ports:
      - "9735:9735"
      - "10009:10009"
  bitcoind:
    build: ./data-sources/bitcoind
    volumes:
      - ./data-sources/bitcoind/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
    command: bitcoind  --datadir=/home/bitcoin/.bitcoin --printtoconsole -rpcallowip=0.0.0.0/0
    ports:
      - "18443:18443"
      - "28332:28332"
      - "28333:28333"
  app:
    image: node:8
    working_dir: /home/node/app
    volumes:
      - shared:/home/node/.lnd/
      - ./data-sources/lnd/lnd.conf:/home/node/.lnd/lnd.conf
      - ./:/home/node/app
    ports:
      - "9001:9000"
      - "3304:3304"
      - "3009:3009"
      - "3098:3098"
    command: "npm start --unsafe-perm"
    environment:
      - RPC_PORT=18443
      - RPC_HOST=bitcoind
      - RPC_USERNAME=rpcuser
      - RPC_PASSWORD=rpcpassword
      - GRPC_SSL_CIPHER_SUITES=HIGH+ECDSA
      - LNSERVICE_LND_DIR=/home/node/.lnd
      - LNSERVICE_CHAIN=bitcoin
      - LNSERVICE_NETWORK=regtest
      - LNSERVICE_SECRET_KEY=rpcpassword
      - LND_HOST=lnd
      - LND_GRPC_PORT=10009

volumes:
  shared:
    driver: local
