docker-compose.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. version: '2'
  2. services:
  3. ca0:
  4. image: hyperledger/fabric-ca
  5. environment:
  6. - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
  7. ports:
  8. - "7054:7054"
  9. command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/a22daf356b2aab5792ea53e35f66fccef1d7f1aa2b3a2b92dbfbf96a448ea26a_sk -b admin:adminpw' -d
  10. volumes:
  11. - ./channel/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
  12. - ./fabricca/tlsOrg1:/etc/hyperledger/fabric-ca-server
  13. container_name: ca_peerOrg1
  14. ca1:
  15. image: hyperledger/fabric-ca
  16. environment:
  17. - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
  18. ports:
  19. - "8054:7054"
  20. command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/464d550fe9bf9e7d8976cdf59d1a5d472598f54c058c3546317c5c5fb0ddfd6e_sk -b admin:adminpw' -d
  21. volumes:
  22. - ./channel/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
  23. - ./fabricca/tlsOrg2:/etc/hyperledger/fabric-ca-server
  24. container_name: ca_peerOrg2
  25. orderer0:
  26. container_name: orderer0
  27. image: hyperledger/fabric-orderer
  28. environment:
  29. - GRPC_TRACE=all
  30. - GRPC_VERBOSITY=debug
  31. - ORDERER_GENERAL_LOGLEVEL=debug
  32. - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
  33. - ORDERER_GENERAL_GENESISMETHOD=file
  34. - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/twoorgs.genesis.block
  35. - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
  36. - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer
  37. - ORDERER_GENERAL_TLS_ENABLED=true
  38. - ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/tls/orderer/key.pem
  39. - ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/tls/orderer/cert.pem
  40. - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/tls/orderer/ca-cert.pem, /etc/hyperledger/tls/peers/peer0/ca-cert.pem, /etc/hyperledger/tls/peers/peer2/ca-cert.pem]
  41. working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
  42. command: orderer
  43. ports:
  44. - 7050:7050
  45. volumes:
  46. - ./channel:/etc/hyperledger/configtx
  47. - ./channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer
  48. - ./tls/orderer:/etc/hyperledger/tls/orderer
  49. - ./tls/peers:/etc/hyperledger/tls/peers
  50. peer0:
  51. container_name: peer0
  52. image: hyperledger/fabric-peer
  53. environment:
  54. - GRPC_TRACE=all
  55. - GRPC_VERBOSITY=debug
  56. - CORE_NEXT=true
  57. - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  58. - CORE_PEER_ID=peer0
  59. - CORE_PEER_ENDORSER_ENABLED=true
  60. - CORE_PEER_LOCALMSPID=Org1MSP
  61. - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  62. - CORE_PEER_GOSSIP_USELEADERELECTION=true
  63. - CORE_PEER_GOSSIP_ORGLEADER=false
  64. - CORE_PEER_ADDRESS=peer0:7051
  65. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0:7051
  66. - CORE_PEER_TLS_ENABLED=true
  67. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
  68. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
  69. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
  70. # the following setting starts chaincode containers on the same
  71. # bridge network as the peers
  72. # https://docs.docker.com/compose/networking/
  73. - CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
  74. - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
  75. working_dir: /opt/gopath/src/github.com/hyperledger/fabric
  76. command: peer node start --peer-defaultchain=false
  77. ports:
  78. - 7051:7051
  79. - 7053:7053
  80. volumes:
  81. - /var/run/:/host/var/run/
  82. - ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peer
  83. - ./tls/peers/peer0:/etc/hyperledger/tls
  84. depends_on:
  85. - orderer0
  86. peer2:
  87. container_name: peer2
  88. image: hyperledger/fabric-peer
  89. environment:
  90. - CORE_NEXT=true
  91. - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  92. - CORE_PEER_ID=peer2
  93. - CORE_PEER_ENDORSER_ENABLED=true
  94. - CORE_PEER_LOCALMSPID=Org2MSP
  95. - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  96. - CORE_PEER_GOSSIP_USELEADERELECTION=true
  97. - CORE_PEER_GOSSIP_ORGLEADER=false
  98. - CORE_PEER_ADDRESS=peer2:7051
  99. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer2:7051
  100. - CORE_PEER_TLS_ENABLED=true
  101. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
  102. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
  103. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
  104. # the following setting starts chaincode containers on the same
  105. # bridge network as the peers
  106. # https://docs.docker.com/compose/networking/
  107. - CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
  108. - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
  109. working_dir: /opt/gopath/src/github.com/hyperledger/fabric
  110. command: peer node start --peer-defaultchain=false
  111. ports:
  112. - 8051:7051
  113. - 8053:7053
  114. volumes:
  115. - /var/run/:/host/var/run/
  116. - ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/msp/peer
  117. - ./tls/peers/peer2:/etc/hyperledger/tls
  118. depends_on:
  119. - orderer0
  120. couchdb:
  121. container_name: couchdb
  122. image: hyperledger/fabric-couchdb
  123. ports:
  124. - 5984:5984
  125. environment:
  126. DB_URL: http://localhost:5984/member_db