forked from ratnakar-asara/Fabric_SampleWebApp
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yaml
188 lines (173 loc) · 7.05 KB
/
docker-compose.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
version: '2'
volumes:
com_example_org0_ca__volume:
com_example_org0_peer0__volume:
com_example_org0_peer1__volume:
com_example_org1_ca__volume:
com_example_org1_peer0__volume:
com_example_org1_peer1__volume:
#com_example_org2_ca__volume:
com_example_org2_orderer__volume:
com_example_www__config_volume:
com_example_www__home_volume:
com_example_www__node_modules_volume:
services:
ca.org0.example.com:
container_name: ca.org0.example.com
extends:
file: docker/ca-base.yaml
service: ca-base
volumes:
# This is the persistent storage volume for the CA.
- com_example_org0_ca__volume:/var/hyperledger/ca:rw
# This is not necessary -- just a little self-documenting hint that this service is being offered on port 7054
ports:
- 7054:7054
ca.org1.example.com:
container_name: ca.org1.example.com
extends:
file: docker/ca-base.yaml
service: ca-base
volumes:
# This is the persistent storage volume for the CA.
- com_example_org0_ca__volume:/var/hyperledger/ca:rw
# This is really only necessary if you want to access this service from the host.
# Configurations within these docker-compose services should just use the native port 7054 (since
# each service has its own IP address). In particular, within the docker services, this
# service is available on address ca.org1.example.com:7054
ports:
- 8054:7054
orderer.org2.example.com:
container_name: orderer.org2.example.com
image: hyperledger/fabric-orderer:x86_64-1.0.1
environment:
- FABRIC_CFG_PATH=/var/hyperledger/orderer
- ORDERER_GENERAL_LOGLEVEL=$GENERAL_LOGGING_LEVEL
- ORDERER_MSP_LOGLEVEL=DEBUG
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=Org2MSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
- ORDERER_GENERAL_TLS_ENABLED=$TLS_ENABLED
- 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]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- com_example_org2_orderer__volume:/var/hyperledger/orderer:rw
ports:
- 7050:7050
peer0.org0.example.com:
container_name: peer0.org0.example.com
extends:
file: docker/peer-base.yaml
service: peer-base
environment:
- CORE_LOGGING_LEVEL=$GENERAL_LOGGING_LEVEL
- CORE_PEER_ID=peer0.org0.example.com
- CORE_PEER_ADDRESS=peer0.org0.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org0.example.com:7051
- CORE_PEER_LOCALMSPID=Org0MSP
volumes:
- com_example_org0_peer0__volume:/var/hyperledger/peer:rw
ports:
- 7051:7051
- 7053:7053
peer1.org0.example.com:
container_name: peer1.org0.example.com
extends:
file: docker/peer-base.yaml
service: peer-base
environment:
- CORE_LOGGING_LEVEL=$GENERAL_LOGGING_LEVEL
- CORE_PEER_ID=peer1.org0.example.com
- CORE_PEER_ADDRESS=peer1.org0.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org0.example.com:7051
- CORE_PEER_LOCALMSPID=Org0MSP
volumes:
- com_example_org0_peer1__volume:/var/hyperledger/peer:rw
# This is really only necessary if you want to access this service from the host.
# Configurations within these docker-compose services should just use the native ports (since
# each service has its own IP address). In particular, within the docker services, this
# service is available on address peer1.org0.example.com:7051 (and 7053)
ports:
- 7056:7051
- 7058:7053
peer0.org1.example.com:
container_name: peer0.org1.example.com
extends:
file: docker/peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- com_example_org1_peer0__volume:/var/hyperledger/peer:rw
# This is really only necessary if you want to access this service from the host.
# Configurations within these docker-compose services should just use the native ports (since
# each service has its own IP address). In particular, within the docker services, this
# service is available on address peer0.org1.example.com:7051 (and 7053)
ports:
- 8051:7051
- 8053:7053
peer1.org1.example.com:
container_name: peer1.org1.example.com
extends:
file: docker/peer-base.yaml
service: peer-base
environment:
- CORE_LOGGING_LEVEL=$GENERAL_LOGGING_LEVEL
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- com_example_org1_peer1__volume:/var/hyperledger/peer:rw
# This is really only necessary if you want to access this service from the host.
# Configurations within these docker-compose services should just use the native ports (since
# each service has its own IP address). In particular, within the docker services, this
# service is available on address peer1.org1.example.com:7051 (and 7053)
ports:
- 8056:7051
- 8058:7053
webserver:
container_name: www.example.com
image: hyperledger/fabric-baseimage:x86_64-0.3.0
working_dir: /var/hyperledger/www
environment:
# This is what enables full debug output in the fabric-sdk-node modules.
- 'HFC_LOGGING={"debug":"console"}'
## This uses the level specified by the GENERAL_LOGGING_LEVEL env var.
#- 'HFC_LOGGING={"$GENERAL_LOGGING_LEVEL":"console"}'
- TLS_ENABLED=$TLS_ENABLED
command: |
bash -x -c "
cp ${COMPOSE_PROJECT_NAME}/web/server/package.json . && \
npm install && \
cd ${COMPOSE_PROJECT_NAME}/web/server && \
npm start
"
#npm test
ports:
- 3000:3000
volumes:
# This is to contain and persist the webserver keystore
- com_example_www__home_volume:/var/hyperledger/www:rw
# This is to contain and persist node_modules
- com_example_www__node_modules_volume:/var/hyperledger/www/node_modules:rw
# Mount the volume with config/crypto materials (this probably has to be mounted after /var/hyperledger/www)
- com_example_www__config_volume:/var/hyperledger/www/config:ro
# Mount this project's files. TODO: Mount only the minimal necessary files (move necessary certs to under web/server)
- .:/var/hyperledger/www/${COMPOSE_PROJECT_NAME}:ro
depends_on:
- ca.org0.example.com
- ca.org1.example.com
- orderer.org2.example.com
- peer0.org0.example.com
- peer1.org0.example.com
- peer0.org1.example.com
- peer1.org1.example.com