-
Notifications
You must be signed in to change notification settings - Fork 184
/
docker-compose-orderer.yaml
218 lines (202 loc) · 10.4 KB
/
docker-compose-orderer.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
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
#
# Copyright . All Rights Reserved.
#
version: '3.7'
volumes:
orderer:
services:
pre-install:
container_name: pre-install.${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}
image: ${DOCKER_REGISTRY:-docker.io}/${FABRIC_STARTER_REPOSITORY:-olegabu}/fabric-tools-extended:${FABRIC_STARTER_VERSION:-stable}
environment:
- ORDERER=true
- ORDERER_NAME=${ORDERER_NAME:-orderer}
- ORDERER_NAME_PREFIX=${ORDERER_NAME_PREFIX:-raft}
- ORDERER_NAMES
- CONSENTER_ID
- PEER_NAME=${PEER_NAME:-peer0}
- PEER_ADDRESS_PREFIX=${PEER_ADDRESS_PREFIX:-peer0.}
- ORG=${ORG:-org1}
- PEER0_PORT=${PEER0_PORT}
- DOMAIN=${DOMAIN:-example.com}
- ORDERER_DOMAIN
- INTERNAL_DOMAIN
- ORDERER_PROFILE=${ORDERER_PROFILE:-Solo}
- ORDERER_GENERAL_LISTENPORT=${ORDERER_GENERAL_LISTENPORT:-7050}
- ORDERER_BATCH_TIMEOUT=${ORDERER_BATCH_TIMEOUT:-2}
- MY_IP
- WWW_PORT=${WWW_PORT:-80}
- RAFT0_CONSENTER_PORT=${RAFT0_CONSENTER_PORT:-7050}
- RAFT1_CONSENTER_PORT=${RAFT1_CONSENTER_PORT:-7150}
- RAFT2_CONSENTER_PORT=${RAFT2_CONSENTER_PORT:-7250}
- RAFT_NODES_COUNT=${RAFT_NODES_COUNT:-1}
- RAFT_NODES_NUMBERING_START=${RAFT_NODES_NUMBERING_START:-0}
- SIGNATURE_HASH_FAMILY=${SIGNATURE_HASH_FAMILY:-SHA2}
- USER_ID
- TMP_DIR
- CERTS_DIR
working_dir: /etc/hyperledger
command: sh -c "touch crypto-config/hosts; container-scripts/container-orderer.sh; set -x; chown -R \${USER_ID} crypto-config; set +x"
volumes:
- ${FABRIC_STARTER_HOME:-.}/crypto-config:/etc/hyperledger/crypto-config
- ${FABRIC_STARTER_HOME:-.}/crypto-config/ordererOrganizations/${DOMAIN}/msp/.well-known:/etc/hyperledger/crypto-config/ordererOrganizations/${DOMAIN}/msp/.well-known
# - ./templates:/etc/hyperledger/templates # for local debug
# - ./container-scripts:/etc/hyperledger/container-scripts # for local debug
post-install:
container_name: post-install.${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}
image: ${DOCKER_REGISTRY:-docker.io}/${FABRIC_STARTER_REPOSITORY:-olegabu}/fabric-tools-extended:${FABRIC_STARTER_VERSION:-stable}
environment:
- ORDERER=true
- CONSORTIUM_CONFIG
- CORE_PEER_LOCALMSPID=${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/crypto-config/ordererOrganizations/${DOMAIN:-example.com}/users/Admin@${DOMAIN:-example.com}/msp
- SIGNATURE_HASH_FAMILY=${SIGNATURE_HASH_FAMILY:-SHA2}
working_dir: /etc/hyperledger
# command: container-scripts/consortium-reconfigure.sh
depends_on:
- orderer
orderer:
container_name: ${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}
restart: always
image: ${DOCKER_REGISTRY:-docker.io}/hyperledger/fabric-orderer:${FABRIC_VERSION:-2.3}
environment:
- FABRIC_LOGGING_SPEC=${FABRIC_LOGGING_SPEC:-orderer=DEBUG:endorser=DEBUG:nodeCmd=DEBUG:committer=DEBUG}
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/${DOMAIN:-example.com}/genesis.pb
- ORDERER_GENERAL_LOCALMSPID=orderer.${DOMAIN:-example.com}
- ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/crypto/orderer/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}/msp
- ORDERER_GENERAL_LISTENPORT=${ORDERER_GENERAL_LISTENPORT:-7050}
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/crypto/orderer/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/crypto/orderer/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/crypto/orderer/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}/tls/ca.crt]
- ORDERER_OPERATIONS_LISTENADDRESS=${ORDERER_OPERATIONS_LISTENADDRESS:-0.0.0.0:9090}
- ORDERER_OPERATIONS_TLS_ENABLED=false
- ORDERER_METRICS_PROVIDER=prometheus
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/crypto/orderer/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}/tls/server.crt
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/crypto/orderer/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}/tls/server.key
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/etc/hyperledger/crypto/orderer/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}/tls/ca.crt]
- ORDERER_GENERAL_KEEPALIVE_SERVERINTERVAL=${KEEPALIVE_INTERVAL:-7200s}
working_dir: /etc/hyperledger
command: sh -c "sleep 3 && orderer"
depends_on:
- pre-install
logging:
options:
max-size: "${LOG_FILES_MAX_SIZE:-10m}"
max-file: "1"
volumes:
- ${FABRIC_STARTER_HOME:-.}/crypto-config/configtx:/etc/hyperledger/configtx
- ${FABRIC_STARTER_HOME:-.}/crypto-config/ordererOrganizations/${DOMAIN:-example.com}/orderers/:/etc/hyperledger/crypto/orderer
- orderer:/var/hyperledger/production/orderer
- ${FABRIC_STARTER_HOME:-.}/crypto-config/hosts:/etc/hosts
cli.orderer:
container_name: cli.${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}
image: ${DOCKER_REGISTRY:-docker.io}/${FABRIC_STARTER_REPOSITORY:-olegabu}/fabric-tools-extended:${FABRIC_STARTER_VERSION:-stable}
restart: always
tty: true
environment:
- ORG=${ORG:-org1}
- DOMAIN=${DOMAIN:-example.com}
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/${DOMAIN:-example.com}/genesis.pb
- ORDERER_GENERAL_LOCALMSPID=orderer.${DOMAIN:-example.com}
- 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]
- ORDERER_GENERAL_LISTENPORT=${ORDERER_GENERAL_LISTENPORT:-7050}
- CORE_PEER_LOCALMSPID=orderer.${DOMAIN:-example.com}
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/crypto/ordereradmin/msp
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/crypto/orderer/tls/ca.crt
- ORDERER_NAME=${ORDERER_NAME:-orderer}
- ORDERER_NAME_PREFIX=${ORDERER_NAME_PREFIX:-raft}
- ORDERER_DOMAIN
- DNS_CHANNEL
- ORDERER_BATCH_TIMEOUT=${ORDERER_BATCH_TIMEOUT:-2}
- SIGNATURE_HASH_FAMILY=${SIGNATURE_HASH_FAMILY:-SHA2}
- WGET_CMD
- FABRIC_VERSION
working_dir: /etc/hyperledger
depends_on:
- pre-install
- post-install
volumes:
- ${FABRIC_STARTER_HOME:-.}/crypto-config:/etc/hyperledger/crypto-config
- ${FABRIC_STARTER_HOME:-.}/crypto-config/ordererOrganizations/${DOMAIN:-example.com}/orderers/${ORDERER_NAME:-orderer}.${DOMAIN:-example.com}:/etc/hyperledger/crypto/orderer
- ${FABRIC_STARTER_HOME:-.}/crypto-config/ordererOrganizations/${DOMAIN:-example.com}/users/Admin@${DOMAIN:-example.com}:/etc/hyperledger/crypto/ordereradmin
- ${FABRIC_STARTER_HOME:-.}/crypto-config/hosts:/etc/hosts
# - ./crypto-config/ordererOrganizations/${DOMAIN:-example.com}/orderers:/etc/hyperledger/crypto/orderers
# - ./templates:/etc/hyperledger/templates # for local debug
# - ${FABRIC_STARTER_HOME:-.}/container-scripts:/etc/hyperledger/container-scripts # for local debug
# fabric-rest api server
# api.orderer:
# # build: ../fabric-starter-rest
# image: olegabu/fabric-starter-rest
# container_name: api.${DOMAIN:-example.com}
# ports:
# - ${ORDERER_API_PORT:-4500}:3000
# environment:
# - ORG=${ORG:-orderer}
# - DOMAIN=${DOMAIN:-example.com}
# - CRYPTO_CONFIG_DIR=/usr/src/app/crypto-config
# - WEBAPP_DIR=/usr/src/app/webapp
# - MSP_DIR=/usr/src/app/msp
# - ORGS=${ORGS:-"orderer":"peer0.org1.example.com:7051"}
# - CAS=${CAS:-"org1":"ca.org1.example.com:7054"}
# - DISCOVER_AS_LOCALHOST=false
# - ENROLL_ID
# - ENROLL_SECRET
# - P=${PWD}
# - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
# - ORDERER_GENERAL_LOCALMSPID=orderer
# - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/crypto/orderer/msp
# - 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]
# - CORE_PEER_LOCALMSPID=orderer
# - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/crypto/ordereradmin/msp
# - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/crypto/orderer/tls/ca.crt
# depends_on:
# - orderer
# volumes:
# - ../fabric-starter-rest:/usr/src/app
# - ./crypto-config:/usr/src/app/crypto-config
# - ./webapp:/usr/src/app/webapp
# - ./crypto-config/ordererOrganizations/${DOMAIN:-example.com}/msp:/usr/src/app/msp
# - ./crypto-config/ordererOrganizations/${DOMAIN:-example.com}/orderers/orderer.${DOMAIN:-example.com}:/etc/hyperledger/crypto/orderer
# - ./crypto-config/ordererOrganizations/${DOMAIN:-example.com}/users/Admin@${DOMAIN:-example.com}:/etc/hyperledger/crypto/ordereradmin
#
# command: sh -c "sleep 3 && npm start"
# privileged: true
# http serves certificates
# www.orderer:
# image: ${DOCKER_REGISTRY:-docker.io}/nginx
# container_name: www.${DOMAIN:-example.com}
# # ports:
# # - ${WWW_PORT:-8080}:80
# volumes:
# - ./crypto-config/ordererOrganizations/${DOMAIN:-example.com}/msp:/usr/share/nginx/html/msp
# - ./crypto-config/ordererOrganizations/${DOMAIN:-example.com}/msp/well-known:/usr/share/nginx/html/.well-known
# depends_on:
# - post-install
www.orderer:
image: ${DOCKER_REGISTRY:-docker.io}/nginx
container_name: www.${DOMAIN:-example.com}
restart: always
# ports:
# - ${WWW_PORT:-8080}:80
volumes:
- ${FABRIC_STARTER_HOME:-.}/crypto-config/node-certs:/usr/share/nginx/html/node-certs:ro
- ${FABRIC_STARTER_HOME:-.}/crypto-config/ordererOrganizations/${DOMAIN:-example.com}/msp:/usr/share/nginx/html/msp
- ${FABRIC_STARTER_HOME:-.}/crypto-config/ordererOrganizations/${DOMAIN:-example.com}/msp/.well-known:/usr/share/nginx/html/.well-known
depends_on:
- pre-install
networks:
default:
external: false
name: fabric-starter_default