version: '2'

services:

  orderer0:
    container_name: orderer0
    image: hyperledger/fabric-orderer
    environment:
      - ORDERER_GENERAL_LOGLEVEL=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/orderer.ordererOrg1
      # enabled TLS
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/orderer.ordererOrg1/tls_config/orderer0Signer-orderer0-ordererOrg0-tls.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/orderer.ordererOrg1/tls_config/orderer0Signer-orderer0-ordererOrg0-tls.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/tls/orderer/ordererOrg0.pem, /var/hyperledger/tls/peers/peerOrg0.pem]
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    volumes:
      - ./crypto-config/ordererOrganizations/ordererOrg1/orderers/:/var/hyperledger/orderer
      - ./crypto-config/ordererOrganizations/ordererOrg1/msp/cacerts:/var/hyperledger/tls/orderer
      - ./crypto-config/peerOrganizations/peerOrg1/msp/cacerts:/var/hyperledger/tls/peers
    ports:
      - 7050:7050

