2
0

docker-compose.yaml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. version: '2'
  2. services:
  3. orderer0:
  4. container_name: orderer0
  5. image: hyperledger/fabric-orderer
  6. environment:
  7. - ORDERER_GENERAL_LOGLEVEL=debug
  8. - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
  9. - ORDERER_GENERAL_GENESISMETHOD=file
  10. - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.block
  11. - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
  12. - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/localMspConfig
  13. # enabled TLS
  14. - ORDERER_GENERAL_TLS_ENABLED=true
  15. - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/localMspConfig/keystore/ordererSigner.pem
  16. - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/localMspConfig/signcerts/orderer0Signer.pem
  17. - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/localMspConfig/cacerts/ordererOrg0.pem]
  18. working_dir: /opt/gopath/src/github.com/hyperledger/fabric
  19. command: orderer
  20. volumes:
  21. - ./crypto/orderer:/var/hyperledger/orderer
  22. ports:
  23. - 7050:7050
  24. ## To enable CouchDB as state database, uncomment the following sections of this file:
  25. ## 1) couchdb containers
  26. ## 2) peer environment variables CORE_LEDGER_STATE_STATEDATABASE and
  27. ## CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS
  28. ## 3) couch container names in "depends_on" section
  29. couchdb0:
  30. container_name: couchdb0
  31. image: hyperledger/fabric-couchdb
  32. # Uncomment the port mapping if you want to expose the CouchDB service,
  33. # for example to utilize Fauxton User Interface in dev environments.
  34. ports:
  35. - "5984:5984"
  36. peer0:
  37. container_name: peer0
  38. extends:
  39. file: peer-base/peer-base.yaml
  40. service: peer-base
  41. environment:
  42. - CORE_PEER_ID=peer0
  43. - CORE_PEER_ADDRESS=peer0:7051
  44. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0:7051
  45. - CORE_PEER_LOCALMSPID=Org0MSP
  46. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer0Signer.pem
  47. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer0Signer.pem
  48. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/cacerts/peerOrg0.pem
  49. # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0
  50. - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
  51. - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
  52. volumes:
  53. - /var/run/:/host/var/run/
  54. - ./crypto/peer/peer0/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
  55. ports:
  56. - 7051:7051
  57. - 7053:7053
  58. depends_on:
  59. - orderer0
  60. - couchdb0
  61. couchdb1:
  62. container_name: couchdb1
  63. image: hyperledger/fabric-couchdb
  64. # Uncomment the port mapping if you want to expose the CouchDB service,
  65. # for example to utilize Fauxton User Interface in dev environments.
  66. ports:
  67. - "6984:5984"
  68. peer1:
  69. container_name: peer1
  70. extends:
  71. file: peer-base/peer-base.yaml
  72. service: peer-base
  73. environment:
  74. - CORE_PEER_ID=peer1
  75. - CORE_PEER_ADDRESS=peer1:7051
  76. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1:7051
  77. - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051
  78. - CORE_PEER_LOCALMSPID=Org0MSP
  79. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer1Signer.pem
  80. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer1Signer.pem
  81. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/cacerts/peerOrg0.pem
  82. # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer1
  83. - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
  84. - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb1:5984
  85. volumes:
  86. - /var/run/:/host/var/run/
  87. - ./crypto/peer/peer1/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
  88. ports:
  89. - 8051:7051
  90. - 8053:7053
  91. depends_on:
  92. - orderer0
  93. - peer0
  94. - couchdb1
  95. couchdb2:
  96. container_name: couchdb2
  97. image: hyperledger/fabric-couchdb
  98. # Uncomment the port mapping if you want to expose the CouchDB service,
  99. # for example to utilize Fauxton User Interface in dev environments.
  100. ports:
  101. - "7984:5984"
  102. peer2:
  103. container_name: peer2
  104. extends:
  105. file: peer-base/peer-base.yaml
  106. service: peer-base
  107. environment:
  108. - CORE_PEER_ID=peer2
  109. - CORE_PEER_ADDRESS=peer2:7051
  110. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer2:7051
  111. - CORE_PEER_GOSSIP_BOOTSTRAP=peer2:7051
  112. - CORE_PEER_LOCALMSPID=Org1MSP
  113. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer2Signer.pem
  114. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer2Signer.pem
  115. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/admincerts/peerOrg1.pem
  116. #- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer2
  117. - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
  118. - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb2:5984
  119. volumes:
  120. - /var/run/:/host/var/run/
  121. - ./crypto/peer/peer2/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
  122. ports:
  123. - 9051:7051
  124. - 9053:7053
  125. depends_on:
  126. - orderer0
  127. - peer0
  128. - peer1
  129. - couchdb2
  130. couchdb3:
  131. container_name: couchdb3
  132. image: hyperledger/fabric-couchdb
  133. # Uncomment the port mapping if you want to expose the CouchDB service,
  134. # for example to utilize Fauxton User Interface in dev environments.
  135. ports:
  136. - "8984:5984"
  137. peer3:
  138. container_name: peer3
  139. extends:
  140. file: peer-base/peer-base.yaml
  141. service: peer-base
  142. environment:
  143. - CORE_PEER_ID=peer3
  144. - CORE_PEER_ADDRESS=peer3:7051
  145. - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer3:7051
  146. - CORE_PEER_GOSSIP_BOOTSTRAP=peer2:7051
  147. - CORE_PEER_LOCALMSPID=Org1MSP
  148. - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer3Signer.pem
  149. - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer3Signer.pem
  150. - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/cacerts/peerOrg1.pem
  151. # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer3
  152. - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
  153. - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb3:5984
  154. volumes:
  155. - /var/run/:/host/var/run/
  156. - ./crypto/peer/peer3/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
  157. ports:
  158. - 10051:7051
  159. - 10053:7053
  160. depends_on:
  161. - orderer0
  162. - peer0
  163. - peer1
  164. - peer2
  165. - couchdb3
  166. cli:
  167. container_name: cli
  168. image: hyperledger/fabric-peer
  169. tty: true
  170. environment:
  171. - GOPATH=/opt/gopath
  172. - CORE_PEER_ADDRESSAUTODETECT=true
  173. - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  174. - CORE_LOGGING_LEVEL=DEBUG
  175. - CORE_NEXT=true
  176. - CORE_PEER_ID=cli
  177. - CORE_PEER_ENDORSER_ENABLED=true
  178. - CORE_PEER_ADDRESS=peer0:7051
  179. - CORE_PEER_LOCALMSPID=Org0MSP
  180. - CORE_PEER_TLS_ENABLED=true
  181. - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig/signcerts/peer0Signer.pem
  182. - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig/keystore/peer0Signer.pem
  183. - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig/cacerts/peerOrg0.pem
  184. # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0
  185. - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig
  186. working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
  187. command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; '
  188. #command: /bin/bash
  189. volumes:
  190. - /var/run/:/host/var/run/
  191. - ./examples/:/opt/gopath/src/github.com/hyperledger/fabric/examples/
  192. - ../chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
  193. - ./crypto:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
  194. - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
  195. depends_on:
  196. - orderer0
  197. - peer0
  198. - peer1
  199. - peer2
  200. - peer3