forked from olegabu/fabric-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-ssl.yaml
49 lines (40 loc) · 1.5 KB
/
docker-compose-ssl.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
#
# Copyright . All Rights Reserved.
#
version: '3.7'
services:
certs.generate:
image: ${DOCKER_REGISTRY:-docker.io}/olegabu/fabric-starter-rest:${FABRIC_STARTER_VERSION:-latest}
container_name: certs.${ORG:-org1}.${DOMAIN:-example.com}
environment:
- CERT_ORG=${ORG:-org1}.${DOMAIN:-example.com}
- CERT_DAYS=${CERT_DAYS:-365}
- CERT_COUNTRY=${CERT_COUNTRY:-US}
- CERT_STATE=${CERT_STATE:-N/A}
- CERT_ORGANIZATIONAL_UNIT=${CERT_ORGANIZATIONAL_UNIT:-Hyperledger Fabric Blockchain}
- CERT_COMMON_NAME=${CERT_COMMON_NAME:-Fabric-Starter-Rest-API}
command: bash -c "if [ ! -f '/certs/public.crt' ]; then openssl req -new -newkey rsa:4096 -x509 -sha256 -days $${CERT_DAYS} -nodes -out /certs/public.crt -keyout /certs/private.key -config /templates/ssl-cert.conf; fi"
volumes:
- ./templates:/templates:ro
- ${SSL_CERTS_PATH:-./ssl-certs}:/certs
peer0:
ports:
- ${PEER0_PORT:-7051}:7051
# simple http server to disseminate certificates
www.peer:
environment:
- ORG=${ORG:-org1}
- DOMAIN=${DOMAIN:-example.com}
ports:
- ${API_PORT:-4000}:4000
volumes:
- ./templates:/templates:ro
- ${SSL_CERTS_PATH:-./ssl-certs}:/certs
command: bash -c "envsubst '$$ORG $$DOMAIN' < /templates/nginx.conf > /etc/nginx/conf.d/default.conf && cp /certs/* /etc/nginx/conf.d/ && nginx -g 'daemon off;'"
depends_on:
- certs.generate
- api
networks:
default:
external:
name: fabric-starter_default