github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-supply-chain-master/docker-compose.yaml (about) 1 # Copyright 2017 Intel Corporation 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 # ------------------------------------------------------------------------------ 15 16 version: '2.1' 17 18 services: 19 20 shell: 21 image: supply-shell 22 container_name: supply-shell 23 build: 24 context: . 25 dockerfile: shell/Dockerfile 26 args: 27 - http_proxy 28 - https_proxy 29 - no_proxy 30 volumes: 31 - .:/sawtooth-supply-chain 32 - /sawtooth-supply-chain/asset_client/node_modules 33 - /sawtooth-supply-chain/fish_client/node_modules 34 - /sawtooth-supply-chain/server/node_modules 35 depends_on: 36 - rethink 37 - rest-api 38 environment: 39 - VALIDATOR_URL=tcp://validator:4004 40 - DB_HOST=rethink 41 - SERVER=http://server:3000 42 command: | 43 bash -c " 44 cd asset_client/ && npm run build && cd - && 45 cd fish_client/ && npm run build && cd - && 46 if [ ! -f /root/.sawtooth/keys/root.priv ]; then 47 sawtooth keygen && 48 cd server/ && 49 npm run init && 50 npm run make-asset && 51 npm run make-fish && 52 npm run seed-sample-assets && 53 npm run seed-sample-fish && 54 cd - 55 fi; 56 tail -f /dev/null 57 " 58 59 processor: 60 image: supply-tp 61 container_name: supply-tp 62 build: 63 context: processor/ 64 args: 65 - http_proxy 66 - https_proxy 67 - no_proxy 68 volumes: 69 - .:/sawtooth-supply-chain 70 - /sawtooth-supply-chain/processor/target 71 - /sawtooth-supply-chain/processor/src/messages 72 entrypoint: | 73 bash -c " 74 cargo build && 75 supply-chain-tp -v -C tcp://validator:4004 76 " 77 78 server: 79 image: supply-server 80 container_name: supply-server 81 build: 82 context: . 83 dockerfile: server/Dockerfile 84 args: 85 - http_proxy 86 - https_proxy 87 - no_proxy 88 volumes: 89 - .:/sawtooth-supply-chain 90 - /sawtooth-supply-chain/server/node_modules 91 expose: 92 - 3000 93 ports: 94 - '8020:3000' 95 depends_on: 96 - validator 97 - rethink 98 - shell 99 environment: 100 - VALIDATOR_URL=tcp://validator:4004 101 - DB_HOST=rethink 102 entrypoint: node index.js 103 104 ledger-sync: 105 image: supply-ledger-sync 106 container_name: supply-ledger-sync 107 build: 108 context: . 109 dockerfile: ledger_sync/Dockerfile 110 args: 111 - http_proxy 112 - https_proxy 113 - no_proxy 114 volumes: 115 - .:/sawtooth-supply-chain 116 - /sawtooth-supply-chain/ledger_sync/node_modules 117 depends_on: 118 - validator 119 - rethink 120 environment: 121 - VALIDATOR_URL=tcp://validator:4004 122 - DB_HOST=rethink 123 124 asset-client: 125 image: supply-asset-client 126 container_name: supply-asset-client 127 build: ./asset_client 128 volumes: 129 - ./asset_client/public/:/usr/local/apache2/htdocs/ 130 expose: 131 - 80 132 ports: 133 - '8021:80' 134 depends_on: 135 - server 136 137 fish-client: 138 image: supply-fish-client 139 container_name: supply-fish-client 140 build: ./fish_client 141 volumes: 142 - ./fish_client/public/:/usr/local/apache2/htdocs/ 143 expose: 144 - 80 145 ports: 146 - '8022:80' 147 depends_on: 148 - server 149 150 rethink: 151 image: rethinkdb 152 container_name: supply-rethink 153 expose: 154 - 8080 155 - 28015 156 ports: 157 - '8023:8080' 158 - '28020:28015' 159 160 validator: 161 image: hyperledger/sawtooth-validator:1.0 162 container_name: supply-validator 163 expose: 164 - 4004 165 ports: 166 - '4020:4004' 167 # start the validator with an empty genesis batch 168 entrypoint: | 169 bash -c " 170 if [ ! -f /etc/sawtooth/keys/validator.priv ]; then 171 sawadm keygen && 172 sawtooth keygen my_key && 173 sawset genesis -k /root/.sawtooth/keys/my_key.priv && 174 sawadm genesis config-genesis.batch 175 fi; 176 sawtooth-validator -vv \ 177 --endpoint tcp://validator:8800 \ 178 --bind component:tcp://eth0:4004 \ 179 --bind network:tcp://eth0:8800 180 " 181 182 settings-tp: 183 image: hyperledger/sawtooth-settings-tp:1.0 184 container_name: supply-settings-tp 185 depends_on: 186 - validator 187 entrypoint: settings-tp -vv -C tcp://validator:4004 188 189 rest-api: 190 image: hyperledger/sawtooth-rest-api:1.0 191 container_name: supply-rest-api 192 expose: 193 - 8008 194 ports: 195 - '8024:8008' 196 depends_on: 197 - validator 198 entrypoint: | 199 sawtooth-rest-api -vv 200 --connect tcp://validator:4004 201 --bind rest-api:8008