1 Star 0 Fork 0

Hyperledger / grid

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
docker-compose-splinter.yaml 5.38 KB
一键复制 编辑 原始数据 按行查看 历史
# Copyright 2019 Cargill Incorporated
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------------
version: '3.6'
volumes:
contracts-shared:
splinter-shared:
services:
gridd:
image: gridd
container_name: gridd
build:
context: .
dockerfile: daemon/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
- CARGO_ARGS=${CARGO_ARGS}
expose:
- 8080
ports:
- '8080:8080'
entrypoint: |
bash -c "
# we need to wait for the db to have started.
until PGPASSWORD=grid_example psql -h db -U grid -c '\q'; do
>&2 echo \"Database is unavailable - sleeping\"
sleep 1
done
grid -vv database migrate \
-C postgres://grid:grid_example@db/grid &&
gridd -vv -b gridd:8080 -C splinter:http://splinterd:8085 \
--database-url postgres://grid:grid_example@db/grid
"
pike-contract-builder:
image: pike-contract-builder
container_name: pike-contract-builder
build:
context: .
dockerfile: contracts/pike/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
volumes:
- contracts-shared:/usr/share/scar
entrypoint: |
bash -c "
cp /tmp/grid-pike*.scar /usr/share/scar
"
product-contract-builder:
image: product-contract-builder
container_name: product-contract-builder
build:
context: .
dockerfile: contracts/product/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
volumes:
- contracts-shared:/usr/share/scar
entrypoint: |
bash -c "
cp /tmp/grid-product*.scar /usr/share/scar
"
schema-contract-builder:
image: schema-contract-builder
container_name: schema-contract-builder
build:
context: .
dockerfile: contracts/schema/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
volumes:
- contracts-shared:/usr/share/scar
entrypoint: |
bash -c "
cp /tmp/grid-schema*.scar /usr/share/scar
"
tnt-contract-builder:
image: tnt-contract-builder
container_name: tnt-contract-builder
build:
context: .
dockerfile: contracts/track_and_trace/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
volumes:
- contracts-shared:/usr/share/scar
entrypoint: |
bash -c "
cp /tmp/grid-track-and-trace*.scar /usr/share/scar
"
location-contract-builder:
image: location-contract-builder
container_name: location-contract-builder
build:
context: .
dockerfile: contracts/location/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
volumes:
- contracts-shared:/usr/share/scar
entrypoint: |
bash -c "
cp /tmp/grid-location*.scar /usr/share/scar
"
purchase-order-contract-builder:
image: purchase-order-contract-builder
container_name: purchase-order-contract-builder
build:
context: .
dockerfile: contracts/purchase_order/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
volumes:
- contracts-shared:/usr/share/scar
entrypoint: |
bash -c "
cp /tmp/grid-purchase-order*.scar /usr/share/scar
"
db:
image: postgres
container_name: db
restart: always
expose:
- 5432
ports:
- "5432:5432"
environment:
POSTGRES_USER: grid
POSTGRES_PASSWORD: grid_example
POSTGRES_DB: grid
splinter-cli:
image: splintercommunity/splinter-cli:latest
container_name: splinter-cli
volumes:
- splinter-shared:/splinter_shared
command: |
bash -c "
if [ ! -f /splinter_shared/private/server.key ]
then
splinter-cli cert generate \
-d /splinter_shared/ \
--force
fi
"
splinterd:
image: splintercommunity/splinterd:latest
container_name: splinterd
volumes:
- contracts-shared:/usr/share/scar
- splinter-shared:/splinter_shared
entrypoint: |
bash -c "
while [ ! -f /splinter_shared/private/server.key ]; do \
echo 'waiting for certs and keys'; \
sleep 1; \
done && \
# Copy the generated keys and certificates to its expected location
cp -a /splinter_shared/. /etc/splinter/certs && \
mv /etc/splinter/nodes.yaml.example /etc/splinter/nodes.yaml && \
splinterd -vv \
--rest-api-endpoint 0.0.0.0:8085 \
--network-endpoints tcps://0.0.0.0:8044 \
--node-id splinter-node \
--service-endpoint tcp://0.0.0.0:8043 \
--storage yaml \
--tls-client-cert /etc/splinter/certs/client.crt \
--tls-client-key /etc/splinter/certs/private/client.key \
--tls-server-cert /etc/splinter/certs/server.crt \
--tls-server-key /etc/splinter/certs/private/server.key \
--tls-insecure
"
1
https://gitee.com/hyperledger/grid.git
git@gitee.com:hyperledger/grid.git
hyperledger
grid
grid
main

搜索帮助