-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·268 lines (253 loc) · 9.28 KB
/
docker-compose.yml
File metadata and controls
executable file
·268 lines (253 loc) · 9.28 KB
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#
# Copyright IBM Corp All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
#
version: '3'
networks:
basic:
driver: overlay
nointernet:
driver: overlay
internal: true
services:
ca.example.com:
image: hyperledger/fabric-ca
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.example.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${FABRIC_SERVER_CERTIFICATE_FILE}
# ports:
# - "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw'
volumes:
- ./config/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ${COMPOSE_PROJECT_NAME}.ca.example.com
networks:
basic:
nointernet:
aliases:
- ca.example.com
orderer.example.com:
container_name: ${COMPOSE_PROJECT_NAME}.orderer.example.com
image: hyperledger/fabric-orderer
environment:
- ORDERER_GENERAL_LOGLEVEL=info
- 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/msp/orderer/msp
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer
# ports:
# - 7050:7050
volumes:
- ./config/:/etc/hyperledger/configtx
- ./config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer
- ./config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peerOrg1
networks:
basic:
nointernet:
aliases:
- orderer.example.com
peer0.org1.example.com:
container_name: ${COMPOSE_PROJECT_NAME}.peer0.org1.example.com
image: hyperledger/fabric-peer
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.org1.example.com
- CORE_LOGGING_PEER=info
- CORE_CHAINCODE_LOGGING_LEVEL=info
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
# # the following setting starts chaincode containers on the same
# # bridge network as the peers
# # https://docs.docker.com/compose/networking/
# @todo NEXT LINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! was net_basic
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_basic
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984
# The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
# provide the credentials for ledger to connect to CouchDB. The username and password must
# match the username and password set for the associated CouchDB.
- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
# command: peer node start --peer-chaincodedev=true
# ports:
# - 7051:7051
# - 7053:7053
volumes:
- /var/run/:/host/var/run/
- ./config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/msp/peer
- ./config/crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
- ./config:/etc/hyperledger/configtx
depends_on:
- orderer.example.com
- couchdb
networks:
basic:
nointernet:
aliases:
- peer0.org1.example.com
couchdb:
container_name: ${COMPOSE_PROJECT_NAME}.couchdb
image: hyperledger/fabric-couchdb
# Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
# for CouchDB. This will prevent CouchDB from operating in an "Admin Party" mode.
environment:
- COUCHDB_USER=
- COUCHDB_PASSWORD=
# ports:
# - 5984:5984
networks:
basic:
nointernet:
aliases:
- couchdb
cli:
container_name: ${COMPOSE_PROJECT_NAME}.cli
image: hyperledger/fabric-tools
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=info
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
- CORE_CHAINCODE_KEEPALIVE=10
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: /bin/bash
volumes:
- /var/run/:/host/var/run/
- ./chaincode/:/opt/gopath/src/github.com/chaincode/
- ./config/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
# Same as fabric-tools which is not cli
- ./../../nodejs/:/root/nodejs
- ./../../cli/:/root/cli
- ./config/:/root/config
- ./config/crypto-config/:/root/crypto-config
- ./../../contractpen-hyperledger-client/:/root/contractpen-hyperledger-client
- ./bna/:/root/bna
- ./config/crypto-config/hfc-key-store/:/root/nodejs/hfc-key-store
networks:
basic:
nointernet:
aliases:
- cli
#depends_on:
# - orderer.example.com
# - peer0.org1.example.com
# - couchdb
blockchain-explorer-db:
container_name: ${COMPOSE_PROJECT_NAME}.blockchain-explorer-db
image: hyperledger/explorer-db
tty: true
environment:
- DATABASE_DATABASE=explorer_db_name
- DATABASE_USERNAME=hppoc
- DATABASE_PASSWORD=password
volumes:
- ./../../postgreSQLdb/:/opt/
# ports:
# - "5422:5432"
networks:
basic:
nointernet:
aliases:
- blockchain-explorer-db
# image: contractpen/hyperledger-explorer-patched
blockchain-explorer:
container_name: ${COMPOSE_PROJECT_NAME}.blockchain-explorer
image: contractpen/hyperledger-explorer-patched
tty: true
environment:
- DATABASE_HOST=blockchain-explorer-db
- DATABASE_DATABASE=explorer_db_name
- DATABASE_USERNAME=hppoc
- DATABASE_PASSWORD=password
- COMPOSE_PROJECT_UUID=${COMPOSE_PROJECT_UUID}
- PUBLIC_URL=/hyperledger/${COMPOSE_PROJECT_UUID}
volumes:
- ./config/config.json:/opt/explorer/app/platform/fabric/config.json
- ./config/crypto-config:/tmp/crypto
# ports:
# - "8090:8080"
networks:
basic:
nointernet:
aliases:
- blockchain-explorer
commandline:
image: contractpen/commandline
command: sleep infinity
volumes:
- ./../../nodejs/:/home/nodejs
- ./../../cli/:/home/cli
- ./config/:/home/config
- ./config/crypto-config/:/home/crypto-config
- ./../../contractpen-hyperledger-client/:/home/contractpen-hyperledger-client
- ./bna/:/home/bna
container_name: ${COMPOSE_PROJECT_NAME}.commandline
working_dir: /home
# ports:
# - "3000:3000"
networks:
basic:
nointernet:
aliases:
- commandline
hyperledgerfabrictools:
image: hyperledger/fabric-tools
command: sleep infinity
volumes:
- ./../../nodejs/:/home/nodejs
- ./../../cli/:/home/cli
- ./config/:/home/config
- ./config/crypto-config/:/home/crypto-config
- ./../../contractpen-hyperledger-client/:/home/contractpen-hyperledger-client
- ./bna/:/home/bna
container_name: ${COMPOSE_PROJECT_NAME}.hyperledgerfabrictools
working_dir: /home
networks:
basic:
nointernet:
aliases:
- commandline
hyperledgerclient:
image: contractpen/commandline
command: /bin/bash ./contractpen-hyperledger-client/run_in_docker.sh ${COMPOSE_PROJECT_NAME} ${COMPOSE_CONTROLLER_UUID} ${COMPOSE_PROJECT_UUID}
volumes:
- ./../../nodejs/:/home/nodejs
- ./../../cli/:/home/cli
- ./config/:/home/config
- ./config/crypto-config/:/home/crypto-config
- ./../../contractpen-hyperledger-client/:/home/contractpen-hyperledger-client
- ./bna/:/home/bna
# - /Users/philipandrew/.composer/:/root/.composer
container_name: ${COMPOSE_PROJECT_NAME}.hyperledgerclient
working_dir: /home
networks:
basic:
nointernet:
aliases:
- hyperledgerclient
# Do I want playground?
# playground:
# image: hyperledger/composer-playground
# container_name: playground
# networks:
# - basic
# - no-internet
#peer chaincode install -n fabcar -v 1.0 -p . -l golang
#peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l golang -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
#peer chaincode invoke -o orderer.example.com:7050 -C mychannel -n fabcar -c '{"function":"changeCarOwner","Args":["CAR8","NEWOWNER"]}'
# docker exec -ti 03fc263a57a8 psql
# command: bash -c "sleep 10 && /bin/bash /opt/createdb.sh"