2
0

docker-compose.yaml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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/peerOrg1-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/d8a5b3cac1b821f6e4b487ceaf1fd239cdcfc310894150908b90f05e9179556a_sk -b admin:adminpw' -d
  10. volumes:
  11. - ./channel/crypto-config/peerOrganizations/peerOrg1/ca/:/etc/hyperledger/fabric-ca-server-config
  12. container_name: ca_peerOrg1
  13. ca1:
  14. image: hyperledger/fabric-ca
  15. environment:
  16. - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
  17. ports:
  18. - "8054:7054"
  19. command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/peerOrg2-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/96bdb57f4efbdcf201a269899eb47e2a73fbb728ae14d47d0d5afb75ddea71de_sk -b admin:adminpw' -d
  20. volumes:
  21. - ./channel/crypto-config/peerOrganizations/peerOrg2/ca/:/etc/hyperledger/fabric-ca-server-config
  22. container_name: ca_peerOrg2
  23. orderer0:
  24. container_name: orderer0
  25. image: hyperledger/fabric-orderer
  26. environment:
  27. - GRPC_TRACE=all
  28. - GRPC_VERBOSITY=debug
  29. - ORDERER_GENERAL_LOGLEVEL=debug
  30. - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
  31. - ORDERER_GENERAL_GENESISMETHOD=file
  32. - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/twoorgs.orderer.block
  33. - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
  34. - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer
  35. - ORDERER_GENERAL_TLS_ENABLED=true
  36. - ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/tls/orderer/key.pem
  37. - ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/tls/orderer/cert.pem
  38. - 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]
  39. working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
  40. command: orderer
  41. ports:
  42. - 7050:7050
  43. volumes:
  44. - ./channel:/etc/hyperledger/configtx
  45. - ./channel/crypto-config/ordererOrganizations/ordererOrg1/orderers/ordererOrg1orderer1/:/etc/hyperledger/msp/orderer
  46. - ./tls/orderer:/etc/hyperledger/tls/orderer
  47. - ./tls/peers:/etc/hyperledger/tls/peers
  48. couchdb0:
  49. container_name: couchdb0
  50. image: hyperledger/fabric-couchdb
  51. #volumes:
  52. # - /var/hyperledger/couchdb0:/opt/couchdb/data
  53. ports:
  54. - "6984:5984"
  55. peer0:
  56. container_name: peer0
  57. image: hyperledger/fabric-peer
  58. environment:
  59. - CORE_LOGGING_LEVEL=DEBUG
  60. - CORE_NEXT=true
  61. - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  62. - CORE_PEER_ID=peer0
  63. - CORE_PEER_ENDORSER_ENABLED=true
  64. - CORE_PEER_LOCALMSPID=Org1MSP
  65. - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  66. - CORE_PEER_GOSSIP_ORGLEADER=true
  67. - CORE_PEER_ADDRESS=peer0:7051
  68. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0:7051
  69. - CORE_PEER_TLS_ENABLED=true
  70. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
  71. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
  72. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
  73. # the following setting starts chaincode containers on the same
  74. # bridge network as the peers
  75. # https://docs.docker.com/compose/networking/
  76. - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
  77. - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
  78. - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
  79. working_dir: /opt/gopath/src/github.com/hyperledger/fabric
  80. command: peer node start --peer-defaultchain=false
  81. ports:
  82. - 7051:7051
  83. - 7053:7053
  84. volumes:
  85. - /var/run/:/host/var/run/
  86. - ./channel/crypto-config/peerOrganizations/peerOrg1/peers/peerOrg1Peer1/:/etc/hyperledger/msp/peer
  87. - ./tls/peers/peer0:/etc/hyperledger/tls
  88. depends_on:
  89. - orderer0
  90. - couchdb0
  91. peer1:
  92. container_name: peer1
  93. image: hyperledger/fabric-peer
  94. environment:
  95. - CORE_NEXT=true
  96. - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  97. - CORE_PEER_ID=peer1
  98. - CORE_PEER_ENDORSER_ENABLED=true
  99. - CORE_PEER_LOCALMSPID=Org1MSP
  100. - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  101. - CORE_PEER_GOSSIP_ORGLEADER=false
  102. - CORE_PEER_ADDRESS=peer1:7051
  103. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1:7051
  104. - CORE_PEER_TLS_ENABLED=true
  105. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
  106. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
  107. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
  108. # the following setting starts chaincode containers on the same
  109. # bridge network as the peers
  110. # https://docs.docker.com/compose/networking/
  111. - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
  112. working_dir: /opt/gopath/src/github.com/hyperledger/fabric
  113. command: peer node start --peer-defaultchain=false
  114. ports:
  115. - 7056:7051
  116. - 7058:7053
  117. volumes:
  118. - /var/run/:/host/var/run/
  119. - ./channel/crypto-config/peerOrganizations/peerOrg1/peers/peerOrg1Peer2/:/etc/hyperledger/msp/peer
  120. - ./tls/peers/peer1:/etc/hyperledger/tls
  121. depends_on:
  122. - orderer0
  123. - peer0
  124. peer2:
  125. container_name: peer2
  126. image: hyperledger/fabric-peer
  127. environment:
  128. - CORE_NEXT=true
  129. - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  130. - CORE_PEER_ID=peer2
  131. - CORE_PEER_ENDORSER_ENABLED=true
  132. - CORE_PEER_LOCALMSPID=Org2MSP
  133. - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  134. - CORE_PEER_GOSSIP_ORGLEADER=true
  135. - CORE_PEER_ADDRESS=peer2:7051
  136. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer2:7051
  137. - CORE_PEER_TLS_ENABLED=true
  138. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
  139. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
  140. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
  141. # the following setting starts chaincode containers on the same
  142. # bridge network as the peers
  143. # https://docs.docker.com/compose/networking/
  144. - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
  145. working_dir: /opt/gopath/src/github.com/hyperledger/fabric
  146. command: peer node start --peer-defaultchain=false
  147. ports:
  148. - 8051:7051
  149. - 8053:7053
  150. volumes:
  151. - /var/run/:/host/var/run/
  152. - ./channel/crypto-config/peerOrganizations/peerOrg2/peers/peerOrg2Peer1/:/etc/hyperledger/msp/peer
  153. - ./tls/peers/peer2:/etc/hyperledger/tls
  154. depends_on:
  155. - orderer0
  156. peer3:
  157. container_name: peer3
  158. image: hyperledger/fabric-peer
  159. environment:
  160. - CORE_NEXT=true
  161. - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  162. - CORE_PEER_ID=peer3
  163. - CORE_PEER_ENDORSER_ENABLED=true
  164. - CORE_PEER_LOCALMSPID=Org2MSP
  165. - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  166. - CORE_PEER_GOSSIP_ORGLEADER=false
  167. - CORE_PEER_ADDRESS=peer3:7051
  168. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer3:7051
  169. - CORE_PEER_TLS_ENABLED=true
  170. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
  171. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
  172. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
  173. # the following setting starts chaincode containers on the same
  174. # bridge network as the peers
  175. # https://docs.docker.com/compose/networking/
  176. - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
  177. working_dir: /opt/gopath/src/github.com/hyperledger/fabric
  178. command: peer node start --peer-defaultchain=false
  179. ports:
  180. - 8056:7051
  181. - 8058:7053
  182. volumes:
  183. - /var/run/:/host/var/run/
  184. - ./channel/crypto-config/peerOrganizations/peerOrg2/peers/peerOrg2Peer2/:/etc/hyperledger/msp/peer
  185. - ./tls/peers/peer3:/etc/hyperledger/tls
  186. depends_on:
  187. - orderer0
  188. - peer2
  189. couchdb:
  190. container_name: couchdb
  191. #image: couchdb
  192. image: hyperledger/fabric-couchdb
  193. ports:
  194. - 5984:5984
  195. environment:
  196. COUCHDB_USER: admin
  197. COUCHDB_PASSWORD: password
  198. DB_URL: http://localhost:5984/member_db