2017-12-06 22:30:57 +08:00
|
|
|
# https://github.com/yeasy/docker-compose-files/tree/master/hyperledger
|
|
|
|
# This compose file will start a Hyperledger Fabric 1.0 MVE, including
|
|
|
|
# * 2 ca (not in use now)
|
|
|
|
# * 1 orderer
|
|
|
|
# * 4 peers in 2 orgs
|
|
|
|
# * cli for testing
|
|
|
|
# * blockchain-explorer
|
|
|
|
|
|
|
|
version: '2.0'
|
|
|
|
|
|
|
|
services:
|
|
|
|
# ca.org1.example.com:
|
|
|
|
# extends:
|
|
|
|
# file: base-solo.yaml
|
|
|
|
# service: ca.org1.example.com
|
|
|
|
|
|
|
|
# ca.org2.example.com:
|
|
|
|
# extends:
|
|
|
|
# file: base-solo.yaml
|
|
|
|
# service: ca.org2.example.com
|
|
|
|
|
|
|
|
cli:
|
|
|
|
extends:
|
|
|
|
file: base-solo.yaml
|
|
|
|
service: cli
|
|
|
|
|
|
|
|
orderer.example.com: # There can be multiple orderers
|
|
|
|
extends:
|
|
|
|
file: base-solo.yaml
|
|
|
|
service: orderer.example.com
|
|
|
|
|
|
|
|
peer0.org1.example.com:
|
|
|
|
extends:
|
|
|
|
file: base-solo.yaml
|
|
|
|
service: peer0.org1.example.com
|
|
|
|
|
|
|
|
peer1.org1.example.com:
|
|
|
|
extends:
|
|
|
|
file: base-solo.yaml
|
|
|
|
service: peer1.org1.example.com
|
|
|
|
|
|
|
|
peer0.org2.example.com:
|
|
|
|
extends:
|
|
|
|
file: base-solo.yaml
|
|
|
|
service: peer0.org2.example.com
|
|
|
|
|
|
|
|
peer1.org2.example.com:
|
|
|
|
extends:
|
|
|
|
file: base-solo.yaml
|
|
|
|
service: peer1.org2.example.com
|
|
|
|
|
|
|
|
explorer:
|
|
|
|
image: yeasy/blockchain-explorer:latest
|
|
|
|
container_name: explorer
|
|
|
|
hostname: explorer
|
|
|
|
depends_on:
|
|
|
|
- mysql
|
|
|
|
volumes:
|
2017-12-15 12:05:12 +08:00
|
|
|
- ./explorer/config.json:/blockchain-explorer/config.json
|
2017-12-06 22:30:57 +08:00
|
|
|
- ./solo/crypto-config:/blockchain-explorer/first-network/crypto-config
|
|
|
|
ports:
|
|
|
|
- "8080:8080" # HTTP port
|
2017-12-15 12:05:12 +08:00
|
|
|
command: bash -c 'sleep 10; node main.js'
|
2017-12-06 22:30:57 +08:00
|
|
|
|
|
|
|
mysql: # mysql service
|
|
|
|
image: mysql:8.0
|
|
|
|
container_name: mysql
|
|
|
|
hostname: mysql
|
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
- MYSQL_ROOT_PASSWORD=root
|
|
|
|
- MYSQL_DATABASE=fabricexplorer
|
|
|
|
volumes:
|
2017-12-15 12:05:12 +08:00
|
|
|
- ./explorer/fabricexplorer.sql:/docker-entrypoint-initdb.d/fabricexplorer.sql
|
2017-12-06 22:30:57 +08:00
|
|
|
expose:
|
|
|
|
- "3306"
|
|
|
|
#command: bash -c 'mysqld; sleep 1; mysql -uroot -proot < /tmp/fabricexplorer.sql; while true; do sleep 20171117; done'
|
|
|
|
#networks:
|
|
|
|
# default:
|
|
|
|
# external:
|
|
|
|
# name: hyperledger_fabric
|