瀏覽代碼

add couchdb volumes

zjb0807 7 年之前
父節點
當前提交
3ca4441433
共有 5 個文件被更改,包括 12 次插入0 次删除
  1. 2 0
      docker-compose-peer0.yaml
  2. 2 0
      docker-compose-peer1.yaml
  3. 2 0
      docker-compose-peer2.yaml
  4. 2 0
      docker-compose-peer3.yaml
  5. 4 0
      pack.sh

+ 2 - 0
docker-compose-peer0.yaml

@@ -13,6 +13,8 @@ services:
     image: hyperledger/fabric-couchdb
 #   Uncomment the port mapping if you want to expose the CouchDB service,
 #   for example to utilize Fauxton User Interface in dev environments.
+    volumes:
+      - /var/hyperledger/couchdb0:/opt/couchdb/data 
     ports:
       - "5984:5984"
 

+ 2 - 0
docker-compose-peer1.yaml

@@ -13,6 +13,8 @@ services:
     image: hyperledger/fabric-couchdb
 #   Uncomment the port mapping if you want to expose the CouchDB service,
 #   for example to utilize Fauxton User Interface in dev environments.
+    volumes:
+      - /var/hyperledger/couchdb1:/opt/couchdb/data
     ports:
       - "5984:5984"
 

+ 2 - 0
docker-compose-peer2.yaml

@@ -13,6 +13,8 @@ services:
     image: hyperledger/fabric-couchdb
 #   Uncomment the port mapping if you want to expose the CouchDB service,
 #   for example to utilize Fauxton User Interface in dev environments.
+    volumes:
+      - /var/hyperledger/couchdb2:/opt/couchdb/data
     ports:
       - "5984:5984"
 

+ 2 - 0
docker-compose-peer3.yaml

@@ -13,6 +13,8 @@ services:
     image: hyperledger/fabric-couchdb
 #   Uncomment the port mapping if you want to expose the CouchDB service,
 #   for example to utilize Fauxton User Interface in dev environments.
+    volumes:
+      - /var/hyperledger/couchdb3:/opt/couchdb/data
     ports:
       - "5984:5984"
 

+ 4 - 0
pack.sh

@@ -76,6 +76,10 @@ function create_peer() {
         rm -rf $project
         mkdir -p $project
         echo "CHANNEL_NAME=$channel ./docker-compose -f docker-compose-peer"$N".yaml up -d " >> $project/start.sh
+        echo "sleep 2" >> $project/start.sh
+        echo "curl -X PUT http://127.0.0.1:5984/_users" >> $project/start.sh
+        echo "curl -X PUT http://127.0.0.1:5984/_replicator" >> $project/start.sh
+        echo "curl -X PUT http://127.0.0.1:5984/_global_changes" >> $project/start.sh
         echo "docker pull $docker_peer_images" >> $project/download-dockerimages.sh
         echo "docker tag $docker_peer_images hyperledger/fabric-peer" >> $project/download-dockerimages.sh
         echo "docker pull $docker_couchdb_images" >> $project/download-dockerimages.sh