Skip to content

Commit

Permalink
Improve docker-compose formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp99 committed Mar 4, 2024
1 parent d3ff691 commit c14a312
Showing 1 changed file with 75 additions and 56 deletions.
131 changes: 75 additions & 56 deletions test-network/fabric-docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ services:
container_name: ca.orderer.example.com
image: hyperledger/fabric-ca:${FABRIC_CA_VERSION}
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.orderer.example.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server/crypto/ca.orderer.example.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server/crypto/priv-key.pem
- FABRIC_LOGGING_SPEC=${LOGGING_LEVEL}
FABRIC_CA_HOME: /etc/hyperledger/fabric-ca-server
FABRIC_CA_SERVER_CA_NAME: ca.orderer.example.com
FABRIC_CA_SERVER_CA_CERTFILE: >-
/etc/hyperledger/fabric-ca-server/crypto/ca.orderer.example.com-cert.pem
FABRIC_CA_SERVER_CA_KEYFILE: >-
/etc/hyperledger/fabric-ca-server/crypto/priv-key.pem
FABRIC_LOGGING_SPEC: ${LOGGING_LEVEL}
ports:
- 7020:7054
working_dir: /etc/hyperledger/fabric-ca-server
command: sh -c 'fabric-ca-server start -b ${ORDERER_CA_ADMIN_NAME}:${ORDERER_CA_ADMIN_PASSWORD} -d'
command: >-
sh -c
'fabric-ca-server start -b ${ORDERER_CA_ADMIN_NAME}:${ORDERER_CA_ADMIN_PASSWORD} -d'
volumes:
- ../fabric-config/crypto-config/peerOrganizations/orderer.example.com/ca/:/etc/hyperledger/fabric-ca-server/crypto
- ../fabric-config/fabric-ca-server-config/orderer.example.com/fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
Expand All @@ -29,14 +33,15 @@ services:
image: hyperledger/fabric-tools:${FABRIC_VERSION}
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=${LOGGING_LEVEL}
- CORE_PEER_ID=cli.orderer.example.com
- CORE_CHAINCODE_KEEPALIVE=10
GOPATH: /opt/gopath
CORE_VM_ENDPOINT: unix:///host/var/run/docker.sock
FABRIC_LOGGING_SPEC: ${LOGGING_LEVEL}
CORE_PEER_ID: cli.orderer.example.com
CORE_CHAINCODE_KEEPALIVE: '10'
#
- CORE_PEER_LOCALMSPID=OrdererMSP
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/cli/crypto/users/[email protected]/msp
CORE_PEER_LOCALMSPID: OrdererMSP
CORE_PEER_MSPCONFIGPATH: >-
/var/hyperledger/cli/crypto/users/[email protected]/msp
working_dir: /var/hyperledger/cli/
command: /bin/bash
volumes:
Expand All @@ -52,13 +57,14 @@ services:
container_name: fablo-rest.orderer.example.com
image: softwaremill/fablo-rest:${FABLO_REST_VERSION}
environment:
- PORT=8000
- MSP_ID=OrdererMSP
- FABRIC_CA_URL=http://ca.orderer.example.com:7054
- FABRIC_CA_NAME=ca.orderer.example.com
- AS_LOCALHOST=false
- DISCOVERY_URLS=grpc://peer0.org1.example.com:7041
- HFC_LOGGING={"error":"console","warn":"console","info":"console"}
PORT: '8000'
MSP_ID: OrdererMSP
FABRIC_CA_URL: http://ca.orderer.example.com:7054
FABRIC_CA_NAME: ca.orderer.example.com
AS_LOCALHOST: 'false'
DISCOVERY_URLS: grpc://peer0.org1.example.com:7041
HFC_LOGGING: >-
{ "error": "console", "warn": "console", "info": "console" }
ports:
- 8800:8000
networks:
Expand All @@ -68,14 +74,15 @@ services:
container_name: orderer0.group1.orderer.example.com
image: hyperledger/fabric-orderer:${FABRIC_VERSION}
environment:
- FABRIC_LOGGING_SPEC=${LOGGING_LEVEL}
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LISTENPORT=7030
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_BOOTSTRAPFILE=/var/hyperledger/config/Group1Genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
- GODEBUG=netdns=go
FABRIC_LOGGING_SPEC: ${LOGGING_LEVEL}
ORDERER_GENERAL_LISTENADDRESS: '0.0.0.0'
ORDERER_GENERAL_LISTENPORT: '7030'
ORDERER_GENERAL_GENESISMETHOD: file
ORDERER_GENERAL_BOOTSTRAPFILE: >-
/var/hyperledger/config/Group1Genesis.block
ORDERER_GENERAL_LOCALMSPID: OrdererMSP
ORDERER_GENERAL_LOCALMSPDIR: /var/hyperledger/orderer/msp
GODEBUG: netdns=go
working_dir: /var/hyperledger/orderer
command: orderer
ports:
Expand All @@ -92,15 +99,19 @@ services:
container_name: ca.org1.example.com
image: hyperledger/fabric-ca:${FABRIC_CA_VERSION}
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server/crypto/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server/crypto/priv-key.pem
- FABRIC_LOGGING_SPEC=${LOGGING_LEVEL}
FABRIC_CA_HOME: /etc/hyperledger/fabric-ca-server
FABRIC_CA_SERVER_CA_NAME: ca.org1.example.com
FABRIC_CA_SERVER_CA_CERTFILE: >-
/etc/hyperledger/fabric-ca-server/crypto/ca.org1.example.com-cert.pem
FABRIC_CA_SERVER_CA_KEYFILE: >-
/etc/hyperledger/fabric-ca-server/crypto/priv-key.pem
FABRIC_LOGGING_SPEC: ${LOGGING_LEVEL}
ports:
- 7040:7054
working_dir: /etc/hyperledger/fabric-ca-server
command: sh -c 'fabric-ca-server start -b ${ORG1_CA_ADMIN_NAME}:${ORG1_CA_ADMIN_PASSWORD} -d'
command: >-
sh -c
'fabric-ca-server start -b ${ORG1_CA_ADMIN_NAME}:${ORG1_CA_ADMIN_PASSWORD} -d'
volumes:
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server/crypto
- ../fabric-config/fabric-ca-server-config/org1.example.com/fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
Expand All @@ -112,15 +123,16 @@ services:
image: hyperledger/fabric-tools:${FABRIC_VERSION}
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=${LOGGING_LEVEL}
- CORE_PEER_ID=cli.org1.example.com
- CORE_CHAINCODE_KEEPALIVE=10
GOPATH: /opt/gopath
CORE_VM_ENDPOINT: unix:///host/var/run/docker.sock
FABRIC_LOGGING_SPEC: ${LOGGING_LEVEL}
CORE_PEER_ID: cli.org1.example.com
CORE_CHAINCODE_KEEPALIVE: '10'
#
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/cli/crypto/users/[email protected]/msp
- CORE_PEER_ADDRESS=peer0.org1.example.com:7041
CORE_PEER_LOCALMSPID: Org1MSP
CORE_PEER_MSPCONFIGPATH: >-
/var/hyperledger/cli/crypto/users/[email protected]/msp
CORE_PEER_ADDRESS: peer0.org1.example.com:7041
working_dir: /var/hyperledger/cli/
command: /bin/bash
volumes:
Expand All @@ -136,13 +148,14 @@ services:
container_name: fablo-rest.org1.example.com
image: softwaremill/fablo-rest:${FABLO_REST_VERSION}
environment:
- PORT=8000
- MSP_ID=Org1MSP
- FABRIC_CA_URL=http://ca.org1.example.com:7054
- FABRIC_CA_NAME=ca.org1.example.com
- AS_LOCALHOST=false
- DISCOVERY_URLS=grpc://peer0.org1.example.com:7041
- HFC_LOGGING={"error":"console","warn":"console","info":"console"}
PORT: '8000'
MSP_ID: Org1MSP
FABRIC_CA_URL: http://ca.org1.example.com:7054
FABRIC_CA_NAME: ca.org1.example.com
AS_LOCALHOST: false
DISCOVERY_URLS: grpc://peer0.org1.example.com:7041
HFC_LOGGING: >-
{ "error": "console", "warn": "console", "info": "console" }
ports:
- 8801:8000
networks:
Expand All @@ -161,9 +174,12 @@ services:
CORE_PEER_GOSSIP_BOOTSTRAP: peer0.org1.example.com:7041
CORE_PEER_CHAINCODELISTENADDRESS: peer0.org1.example.com:7050
CORE_PEER_MSPCONFIGPATH: /etc/hyperledger/fabric/peer/msp
CORE_CHAINCODE_BUILDER: hyperledger/fabric-ccenv:${FABRIC_CCENV_VERSION}
CORE_CHAINCODE_GOLANG_RUNTIME: hyperledger/fabric-baseos:${FABRIC_BASEOS_VERSION}
CORE_CHAINCODE_JAVA_RUNTIME: hyperledger/fabric-javaenv:${FABRIC_JAVAENV_VERSION}
CORE_CHAINCODE_BUILDER: >-
hyperledger/fabric-ccenv:${FABRIC_CCENV_VERSION}
CORE_CHAINCODE_GOLANG_RUNTIME: >-
hyperledger/fabric-baseos:${FABRIC_BASEOS_VERSION}
CORE_CHAINCODE_JAVA_RUNTIME: >-
hyperledger/fabric-javaenv:${FABRIC_JAVAENV_VERSION}
#
CORE_CHAINCODE_LOGGING_LEVEL: ${LOGGING_LEVEL}
CORE_CHAINCODE_LOGGING_SHIM: ${LOGGING_LEVEL}
Expand All @@ -172,14 +188,16 @@ services:
CORE_OPERATIONS_LISTENADDRESS: peer0.org1.example.com:9440
CORE_METRICS_PROVIDER: prometheus
#
CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE: ${COMPOSE_PROJECT_NAME}_basic
CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE: >-
${COMPOSE_PROJECT_NAME}_basic
CORE_VM_DOCKER_ATTACHSTDOUT: true
CORE_VM_ENDPOINT: unix:///host/var/run/docker.sock
GODEBUG: netdns=go
# enabled gateway
CORE_PEER_GATEWAY_ENABLED: true
#
CORE_CHAINCODE_EXTERNALBUILDERS: "[{name: ccaas_builder, path: /opt/hyperledger/ccaas_builder}]"
CORE_CHAINCODE_EXTERNALBUILDERS: >-
[{name: ccaas_builder, path: /opt/hyperledger/ccaas_builder}]
working_dir: /etc/hyperledger/fabric/peer/
command: peer node start
ports:
Expand All @@ -198,8 +216,9 @@ services:
container_name: tpcc
build: ../../smart-contract/hyperledger-fabric/v2/java/
environment:
- CHAINCODE_SERVER_ADDRESS=0.0.0.0:9999
- CORE_CHAINCODE_ID_NAME=tpcc:a03d5726c28a155d993f6789701908d88746d0e5f0c9078860a7b4ae18411886
CHAINCODE_SERVER_ADDRESS: 0.0.0.0:9999
CORE_CHAINCODE_ID_NAME: >-
tpcc:a03d5726c28a155d993f6789701908d88746d0e5f0c9078860a7b4ae18411886
expose:
- 9999
networks:
Expand Down

0 comments on commit c14a312

Please sign in to comment.