docker-compose-files/hyperledger_fabric/v1.0.2/base.yaml

156 lines
6.5 KiB
YAML
Raw Normal View History

2018-01-18 13:31:00 +08:00
# Contains the base template for all Hyperledger Fabric services
# Never directly use services in this template, but inherent
# All services are abstract without any names, config or port mapping
2017-09-01 20:09:18 +08:00
# https://github.com/yeasy/docker-compose-files
2018-01-18 13:31:00 +08:00
#
# * ca-base: base for fabric-ca
# * orderer-base: base for fabric-orderer
# * peer-base: base for fabric-peer
# * cli-base: base for fabric peer client
# * event-listener-base: base for fabric eventhub listener
# * kafka-base: base for kafka
# * zookeeper-base: base for fabric-zookeeper
# * couchdb-base: base for couchdb
# * explorer-base: base for Hyperledger blockchain-explorer
# * mysql-base: base for MySQL
2017-09-01 20:09:18 +08:00
2018-01-18 13:31:00 +08:00
version: '2' # compose v3 still doesn't support `extends`, shame!
2017-09-01 20:09:18 +08:00
services:
ca-base:
2017-09-29 13:19:06 +08:00
#image: yeasy/hyperledger-fabric-ca:1.0.2
image: hyperledger/fabric-ca:x86_64-1.0.2
restart: always
2017-09-01 20:09:18 +08:00
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
2018-01-18 13:31:00 +08:00
- FABRIC_CA_SERVER_TLS_ENABLED=true # change to false to disable TLS
2017-09-01 20:09:18 +08:00
orderer-base:
2017-09-22 15:16:19 +08:00
#image: yeasy/hyperledger-fabric-orderer:1.0.2
image: hyperledger/fabric-orderer:x86_64-1.0.2
2017-09-29 13:19:06 +08:00
restart: always
2018-01-03 21:19:09 +08:00
# Default config can be found at https://github.com/hyperledger/fabric/blob/master/orderer/common/localconfig/config.go
2017-09-01 20:09:18 +08:00
environment:
2018-01-03 21:19:09 +08:00
- ORDERER_GENERAL_LOGLEVEL=DEBUG # default: INFO
- ORDERER_GENERAL_LOGFORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
2018-01-03 21:19:09 +08:00
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 # default: 127.0.0.1
- ORDERER_GENERAL_GENESISMETHOD=file # default: provisional
2017-09-01 20:09:18 +08:00
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
2018-01-03 21:19:09 +08:00
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP # default: DEFAULT
2017-09-01 20:09:18 +08:00
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
- ORDERER_GENERAL_LEDGERTYPE=file
2018-01-03 21:19:09 +08:00
#- ORDERER_GENERAL_LEDGERTYPE=json # default: file
- ORDERER_GENERAL_BATCHTIMEOUT=1s
2017-09-01 20:09:18 +08:00
- ORDERER_GENERAL_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENPORT=7050
#- ORDERER_RAMLEDGER_HISTORY_SIZE=100 #only useful when use ram ledger
# enabled TLS
2018-01-03 21:19:09 +08:00
- ORDERER_GENERAL_TLS_ENABLED=true # default: false
2017-09-01 20:09:18 +08:00
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
2018-01-30 17:01:41 +08:00
volumes:
- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
2017-09-01 20:09:18 +08:00
expose:
- "7050" #
2018-01-30 17:01:41 +08:00
#command: bash -c 'bash /tmp/orderer_build.sh; orderer start' # use this if to debug orderer
2017-09-01 20:09:18 +08:00
command: orderer start
peer-base:
image: yeasy/hyperledger-fabric-peer:1.0.2
2017-09-29 13:19:06 +08:00
#image: hyperledger/fabric-peer:x86_64-1.0.2
restart: always
2017-09-01 20:09:18 +08:00
environment:
- CORE_PEER_ADDRESSAUTODETECT=false
- CORE_LOGGING_LEVEL=DEBUG
- CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
2017-12-07 10:54:06 +08:00
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=v102_default # uncomment this to use specific network
2017-09-01 20:09:18 +08:00
- CORE_PEER_GOSSIP_USELEADERELECTION=true
2018-01-30 17:01:41 +08:00
- CORE_PEER_GOSSIP_ORGLEADER=false # whether this node is the group leader, default to false
2017-09-01 20:09:18 +08:00
- CORE_PEER_PROFILE_ENABLED=false
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
- CORE_CHIANCODE_LOGGING_LEVEL=DEBUG
- CORE_CHIANCODE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
2018-01-30 17:01:41 +08:00
volumes:
- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
2017-09-01 20:09:18 +08:00
expose:
- "7051" # Grpc
- "7052" # Peer CLI
- "7053" # Peer Event
volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT
- /var/run/docker.sock:/var/run/docker.sock
2018-01-30 17:01:41 +08:00
#volumes:
# - /var/run/:/host/var/run/
#command: bash -c 'bash /tmp/peer_build.sh; peer node start'
2017-09-01 20:09:18 +08:00
command: peer node start
2017-09-13 13:06:52 +08:00
cli-base:
2018-01-18 13:31:00 +08:00
2017-09-22 15:16:19 +08:00
image: hyperledger/fabric-tools:x86_64-1.0.2
2017-09-29 13:19:06 +08:00
restart: always
2017-09-13 13:06:52 +08:00
tty: true
environment:
#- GOPATH=/opt/gopath
- CORE_LOGGING_LEVEL=DEBUG
- CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
2017-09-13 13:06:52 +08:00
- CORE_PEER_TLS_ENABLED=true # to enable TLS, change to true
2018-01-03 21:19:09 +08:00
- ORDERER_CA=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
2017-09-13 13:06:52 +08:00
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
2018-01-03 21:19:09 +08:00
command: bash -c 'cd /tmp; source scripts/func.sh; while true; do sleep 20170504; done'
event-listener-base:
image: yeasy/hyperledger-fabric:1.0.2
restart: always
tty: true
environment:
- CORE_PEER_ID=fabric-event-listener
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=false # event-listener doesn't support TLS
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
#command: bash -c 'block-listener -events-address=peer0.org1.example.com:7053 -events-mspdir=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/ -events-mspid=Org1MSP'
command: bash -c 'while true; do sleep 20170504; done'
2017-09-13 13:06:52 +08:00
zookeeper-base:
image: hyperledger/fabric-zookeeper:x86_64-1.0.2
restart: always
tty: true
expose:
- '2181'
- '2888'
- '3888'
kafka-base:
2018-01-03 21:19:09 +08:00
# official repo doesn't have latest tag, however, kafka changes version recently
#image: yeasy/hyperledger-fabric-kafka:0.10.2.0
image: hyperledger/fabric-kafka:x86_64-1.0.2
restart: always
tty: true
environment:
- KAFKA_MESSAGE_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
- KAFKA_REPLICA_FETCH_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
- KAFKA_LOG_RETENTION_MS=-1
expose:
- '9092'
2018-01-18 13:31:00 +08:00
couchdb-base:
image: hyperledger/fabric-couchdb:x86_64-1.0.2
restart: always
tty: true
explorer-base:
image: yeasy/blockchain-explorer:0.1.0-preview # Till we have official image
expose:
- "8080" # HTTP port
command: bash -c 'sleep 10; node main.js'
mysql-base: # mysql service
image: mysql:8.0
restart: always
expose:
- "3306"