-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose-template.yaml
193 lines (180 loc) · 6.57 KB
/
docker-compose-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#
# Copyright Altoros. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
services:
ca.ORG1.DOMAIN:
container_name: ca.ORG1.DOMAIN
image: hyperledger/fabric-ca
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.ORG1.DOMAIN-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.ORG1.DOMAIN-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG1.DOMAIN/ca/:/etc/hyperledger/fabric-ca-server-config
- ../artifacts/fabric-ca-server-config-ORG1.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
ca.ORG2.DOMAIN:
container_name: ca.ORG2.DOMAIN
image: hyperledger/fabric-ca
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.ORG2.DOMAIN-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA2_PRIVATE_KEY
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.ORG2.DOMAIN-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA2_PRIVATE_KEY
ports:
- "8054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG2.DOMAIN/ca/:/etc/hyperledger/fabric-ca-server-config
- ../artifacts/fabric-ca-server-config-ORG2.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
orderer.DOMAIN:
container_name: orderer.DOMAIN
image: hyperledger/fabric-orderer
environment:
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/crypto/orderer/msp
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/crypto/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/crypto/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/crypto/orderer/tls/ca.crt, /etc/hyperledger/crypto/peerORG1/tls/ca.crt, /etc/hyperledger/crypto/peerORG2/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderers
command: orderer
ports:
- 7050:7050
volumes:
- ../artifacts/channel:/etc/hyperledger/configtx
- ../artifacts/crypto-config/ordererOrganizations/DOMAIN/orderers/orderer.DOMAIN/:/etc/hyperledger/crypto/orderer
- ../artifacts/crypto-config/peerOrganizations/ORG1.DOMAIN/peers/peer0.ORG1.DOMAIN/:/etc/hyperledger/crypto/peerORG1
- ../artifacts/crypto-config/peerOrganizations/ORG2.DOMAIN/peers/peer0.ORG2.DOMAIN/:/etc/hyperledger/crypto/peerORG2
peer0.ORG1.DOMAIN:
container_name: peer0.ORG1.DOMAIN
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.ORG1.DOMAIN
- CORE_PEER_LOCALMSPID=ORG1MSP
- CORE_PEER_ADDRESS=peer0.ORG1.DOMAIN:7051
ports:
- 7051:7051
- 7053:7053
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG1.DOMAIN/peers/peer0.ORG1.DOMAIN/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.DOMAIN
peer1.ORG1.DOMAIN:
container_name: peer1.ORG1.DOMAIN
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.ORG1.DOMAIN
- CORE_PEER_LOCALMSPID=ORG1MSP
- CORE_PEER_ADDRESS=peer1.ORG1.DOMAIN:7051
ports:
- 7056:7051
- 7058:7053
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG1.DOMAIN/peers/peer1.ORG1.DOMAIN/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.DOMAIN
peer0.ORG2.DOMAIN:
container_name: peer0.ORG2.DOMAIN
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.ORG2.DOMAIN
- CORE_PEER_LOCALMSPID=ORG2MSP
- CORE_PEER_ADDRESS=peer0.ORG2.DOMAIN:7051
ports:
- 8051:7051
- 8053:7053
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG2.DOMAIN/peers/peer0.ORG2.DOMAIN/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.DOMAIN
peer1.ORG2.DOMAIN:
container_name: peer1.ORG2.DOMAIN
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.ORG2.DOMAIN
- CORE_PEER_LOCALMSPID=ORG2MSP
- CORE_PEER_ADDRESS=peer1.ORG2.DOMAIN:7051
ports:
- 8056:7051
- 8058:7053
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG2.DOMAIN/peers/peer1.ORG2.DOMAIN/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.DOMAIN
cli.DOMAIN:
container_name: cli.DOMAIN
extends:
file: base.yaml
service: cli-base
volumes:
- ../artifacts/crypto-config/ordererOrganizations/DOMAIN/orderers/orderer.DOMAIN/tls:/etc/hyperledger/crypto/orderer/tls
# api server
api.ORG1.DOMAIN:
extends:
file: base.yaml
service: api-base
container_name: api.ORG1.DOMAIN
ports:
- "4000:4000"
environment:
- ORG=ORG1
- PORT=4000
depends_on:
- cli.ORG1.DOMAIN
api.ORG2.DOMAIN:
extends:
file: base.yaml
service: api-base
container_name: api.ORG2.DOMAIN
ports:
- "4001:4000"
environment:
- ORG=ORG2
- PORT=4000
depends_on:
- cli.ORG2.DOMAIN
cli.ORG1.DOMAIN:
container_name: cli.ORG1.DOMAIN
extends:
service: cli.DOMAIN
environment:
- CORE_PEER_LOCALMSPID=ORG1MSP
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG1.DOMAIN/users/[email protected]:/etc/hyperledger/crypto/peer
depends_on:
- peer0.ORG1.DOMAIN
- peer1.ORG1.DOMAIN
cli.ORG2.DOMAIN:
container_name: cli.ORG2.DOMAIN
extends:
service: cli.DOMAIN
environment:
- CORE_PEER_LOCALMSPID=ORG2MSP
volumes:
- ../artifacts/crypto-config/peerOrganizations/ORG2.DOMAIN/users/[email protected]:/etc/hyperledger/crypto/peer
depends_on:
- peer0.ORG2.DOMAIN
- peer1.ORG2.DOMAIN