Unable to containerise varnish, throws error "Service Unavailable" - docker

varnish.local.php
<?php
return [
'acsi_varnish' => [
'clients' => [
'cache' => [
'endpoint' => [
'host' => 'dev-varnish',
'port' => '8443',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
],
],
],
],
];
default.vcl
vcl 4.1;
backend default {
.host = "dev";
.port = "8080";
}
docker-compose-template.yml
version: '3.7'
services:
dev:
image: dev:centos7
container_name: dev
hostname: dev
volumes:
- ${HOST_BIND_MOUNT_DIR}:${CONTAINER_MOUNT_DIR}
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
networks:
dev-online:
ipv4_address: 172.100.0.2
ports:
- 443:443
# - 6082:6082
- 9001:9001
- 5672:5672
- 15672:15672
- 29015:29015
extra_hosts:
- dev:127.0.0.1
- dev-mysql:172.100.0.3
- dev-mongo-3:172.100.0.4
- dev-mongo-4:172.100.0.5
- dev-solr-6:172.100.0.6
- dev-solr-8:172.100.0.7
- dev-rethinkdb:172.100.0.8
- dev-varnish:172.100.0.10
dev-mysql:
image: dev-mysql-5.7:latest
container_name: dev-mysql
hostname: dev-mysql
user: "${V_UID}:${V_GID}"
volumes:
- ${HOST_BIND_MOUNT_DIR_MYSQL}:${CONTAINER_MOUNT_DIR_MYSQL}
networks:
dev-online:
ipv4_address: 172.100.0.3
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD:${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE:${MYSQL_DATABASE}
extra_hosts:
- dev:172.100.0.2
- dev-mysql:127.0.0.1
- dev-mongo-3:172.100.0.4
- dev-mongo-4:172.100.0.5
- dev-solr-6:172.100.0.6
- dev-solr-8:172.100.0.7
- dev-rethinkdb:172.100.0.8
- dev-memcached:172.100.0.9
- dev-varnish:172.100.0.10
dev-mongo-3:
image: mongo-3.0:dev
container_name: dev-mongo-3
hostname: dev-mongo-3
volumes:
- ${HOST_BIND_MOUNT_DIR_MONGO_3}:${CONTAINER_MOUNT_DIR_MONGO}
privileged: true
networks:
dev-online:
ipv4_address: 172.100.0.4
ports:
- 27017:27017
environment:
- MYSQL_ROOT_PASSWORD="${MYSQL_ROOT_PASSWORD}"
- MYSQL_DATABASE="${MYSQL_DATABASE}"
extra_hosts:
- dev:172.100.0.2
- dev-mysql:172.100.0.3
- dev-mongo-3:127.0.0.1
- dev-mongo-4:172.100.0.5
- dev-solr-6:172.100.0.6
- dev-solr-8:172.100.0.7
- dev-rethinkdb:172.100.0.8
- dev-memcached:172.100.0.9
- dev-varnish:172.100.0.10
dev-mongo-4:
image: mongo-4.4:dev
container_name: dev-mongo-4
hostname: dev-mongo-4
user: "${V_UID}:${V_GID}"
volumes:
- ${HOST_BIND_MOUNT_DIR_MONGO_4}:${CONTAINER_MOUNT_DIR_MONGO}
privileged: true
networks:
dev-online:
ipv4_address: 172.100.0.5
ports:
- 27018:27017
environment:
- MYSQL_ROOT_PASSWORD="${MYSQL_ROOT_PASSWORD}"
- MYSQL_DATABASE="${MYSQL_DATABASE}"
extra_hosts:
- dev:172.100.0.2
- dev-mysql:172.100.0.3
- dev-mongo-3:172.100.0.4
- dev-mongo-4:127.0.0.1
- dev-solr-6:172.100.0.6
- dev-solr-8:172.100.0.7
- dev-rethinkdb:172.100.0.8
- dev-memcached:172.100.0.9
- dev-varnish:172.100.0.10
dev-solr-6:
image: solr-6.6:dev
container_name: dev-solr-6
hostname: dev-solr-6
networks:
dev-online:
ipv4_address: 172.100.0.6
ports:
- 8983:8983
extra_hosts:
- dev:172.100.0.2
- dev-mysql:172.100.0.3
- dev-mongo-3:172.100.0.4
- dev-mongo-4:172.100.0.5
- dev-solr-6:127.0.0.1
- dev-solr-8:172.100.0.7
- dev-rethinkdb:172.100.0.8
- dev-memcached:172.100.0.9
- dev-varnish:172.100.0.10
dev-solr-8:
image: solr-8.6:dev
container_name: dev-solr-8
hostname: dev-solr-8
user: "${V_UID}:${V_GID}"
volumes:
- ${HOST_BIND_MOUNT_DIR_SOLR}:${CONTAINER_MOUNT_DIR_SOLR_8}
networks:
dev-online:
ipv4_address: 172.100.0.7
ports:
- 8984:8983
environment:
- SOLR_HEAP=2g
extra_hosts:
- dev:172.100.0.2
- dev-mysql:172.100.0.3
- dev-mongo-3:172.100.0.4
- dev-mongo-4:172.100.0.5
- dev-solr-6:172.100.0.6
- dev-solr-8:127.0.0.1
- dev-rethinkdb:172.100.0.8
- dev-memcached:172.100.0.9
- dev-varnish:172.100.0.10
dev-rethinkdb:
image: rethinkdb
container_name: dev-rethinkdb
hostname: dev-rethinkdb
user: "${V_UID}:${V_GID}"
volumes:
- ${HOST_BIND_MOUNT_DIR_RETHINKDB}:${CONTAINER_MOUNT_DIR_RETHINKDB}
networks:
dev-online:
ipv4_address: 172.100.0.8
ports:
- 28015:28015
- 8080:8080
extra_hosts:
- dev:172.100.0.2
- dev-mysql:172.100.0.3
- dev-mongo-3:172.100.0.4
- dev-mongo-4:172.100.0.5
- dev-solr-6:172.100.0.6
- dev-solr-8:172.100.0.7
- dev-rethinkdb:127.0.0.1
- dev-memcached:172.100.0.9
- dev-varnish:172.100.0.10
dev-memcached:
image: memcached
container_name: dev-memcached
hostname: dev-memcached
user: "${V_UID}:${V_GID}"
networks:
dev-online:
ipv4_address: 172.100.0.9
ports:
- 11211:11211
extra_hosts:
- dev:172.100.0.2
- dev-mysql:172.100.0.3
- dev-mongo-3:172.100.0.4
- dev-mongo-4:172.100.0.5
- dev-solr-6:172.100.0.6
- dev-solr-8:172.100.0.7
- dev-rethinkdb:172.100.0.8
- dev-memcached:127.0.0.1
- dev-varnish:172.100.0.10
dev-varnish:
image: varnish:7.2.1-alpine
container_name: dev-varnish
hostname: dev-varnish
user: '0'
volumes:
- "./default.vcl:/etc/varnish/default.vcl"
ports:
- "6082:8443"
tmpfs:
- /var/lib/varnish/varnishd:exec
networks:
dev-online:
ipv4_address: 172.100.0.10
extra_hosts:
- dev:172.100.0.2
- dev-mysql:172.100.0.3
- dev-mongo-3:172.100.0.4
- dev-mongo-4:172.100.0.5
- dev-solr-6:172.100.0.6
- dev-solr-8:172.100.0.7
- dev-rethinkdb:172.100.0.8
- dev-varnish:127.0.0.1
- dev-memcached:172.100.0.9
networks:
dev-online:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.100.0.0/24
I am trying to containerise the varnish service which is already working in "dev" container, but after i containerise, i don't see it is working, i am not sure what is going wrong here.
the connection should work in the below flow
https://loadwebsite.com -> "dev" container -> "dev-varnish" container -> "dev" container
the browser throws the error below
"Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."

Please run run docker compose ps dev-varnish to see if the varnishd process is running
Finally run docker compose exec -ti dev-varnish varnishlog -g request to run the varnishlog binary inside the container and output the logs
Please attach the output from varnishlog -g request to your question. This will clarify how Varnish is behaving and can lead to a possible solution.

Related

New version of traefik website is not working properly

I have had nextjs website running on nextjs, traefik 1.7 and docker. Website was working allright but because of a SSL certificate I had to change traefik version to 2.4 so I can load my bought SSL. Since that website is working as before but images won't load. Anyone who could help?
OLD docker-compose
version: '3'
services:
loadbalancer:
restart: unless-stopped
image: traefik:1.7
command: --docker
ports:
- "80:80"
- "443:443"
- "3000:3000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
- ./acme.json:/acme.json:rw
- ./traefik.toml:/traefik.toml:rw
- ./certs:/certs:rw
command:
- --debug=false
- --logLevel=ERROR
- --defaultentrypoints=https,http
- "--entryPoints=Name:http Address::80"
- "--entryPoints=Name:https Address::443 TLS"
- --docker.endpoint=unix:///var/run/docker.sock
- --docker.watch=true
- --docker.exposedbydefault=false
- --acme.email=admin#ssupat.sk
- --acme.storage=acme.json
- --acme.entryPoint=https
- --acme.onHostRule=true
- --acme.httpchallenge.entrypoint=https
security_opt:
- no-new-privileges:true
networks:
- ssupat
cms-postgresql:
restart: unless-stopped
image: 'bitnami/postgresql:latest'
environment:
- POSTGRESQL_USERNAME=ssupat_user
- POSTGRESQL_PASSWORD=password
- POSTGRESQL_DATABASE=ssupat_cms
ports:
- '5432'
networks:
- ssupat
volumes:
- ./db/:/bitnami/postgresql
ssupat-cms-strapi:
restart: unless-stopped
build:
context: ssupat-cms-strapi/
dockerfile: Dockerfile
environment:
DATABASE_CLIENT: postgres
DATABASE_NAME: ssupat_cms
DATABASE_HOST: cms-postgresql
DATABASE_PORT: 5432
DATABASE_USERNAME: ssupat_user
DATABASE_PASSWORD: password
networks:
- ssupat
security_opt:
- no-new-privileges:true
volumes:
- ./app:/srv/app
- ./public:/public/uploads
depends_on:
- "cms-postgresql"
labels:
traefik.frontend.rule: 'Host:cms.ssupat.sk'
traefik.frontend.redirect.regex: ^http?://cms.ssupat.sk/(.*)
traefik.frontend.redirect.replacement: https://cms.ssupat.sk/$${1}
traefik.frontend.redirect.permanent: true
traefik.http.routers.some-name.entryPoints: 'Port:80'
traefik.http.routers.ssupat-cms-strapi.rule: 'Host:cms.ssupat.sk'
traefik.http.routers.my-app.tls: true
traefik.http.routers.my-app.tls.certresolver: 'le-ssl'
traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent: true
traefik.enable: true
traefik.port: 80
traefik.protocol: http
security_opt:
- no-new-privileges:true
ssupat-web-nextjs:
restart: unless-stopped
build:
context: ssupat-web-nextjs/
dockerfile: Dockerfile
networks:
- ssupat
depends_on:
- "ssupat-cms-strapi"
- "cms-postgresql"
labels:
traefik.frontend.rule: 'Host:ssupat.sk,www.ssupat.sk'
traefik.frontend.redirect.regex: ^http?://ssupat.sk/(.*)
traefik.frontend.redirect.replacement: https://ssupat.sk/$${1}
traefik.frontend.redirect.regex: ^http?://www.ssupat.sk/(.*)
traefik.frontend.redirect.replacement: https://ssupat.sk/$${1}
traefik.frontend.redirect.permanent: true
traefik.http.routers.my-app.tls: true
traefik.http.routers.my-app.tls.certresolver: 'le-ssl'
traefik.enable: true
traefik.port: 3000
traefik.protocol: http
security_opt:
- no-new-privileges:true
networks:
ssupat:
driver: bridge
NEW docker-compose
version: '3.3'
networks:
ssupat:
driver: bridge
#networks:
#ssupat:
#external: true
services:
traefik:
#image: traefik:2.4
image: traefik:latest
container_name: traefik
volumes:
- ./certs/traefik-certs/:/etc/traefik/:ro
- /var/run/docker.sock:/var/run/docker.sock
networks:
- ssupat
ports:
- 80:80
- 443:443
- 8080:8080
#- 3000:3000
command:
- '--api.insecure=true'
- '--api.dashboard=true'
- '--api.debug=true'
- '--providers.docker=true'
- '--providers.docker.exposedByDefault=false'
- '--providers.file=true'
- '--providers.file.directory=/etc/traefik/'
- '--entrypoints.http=true'
- '--providers.docker.network=proxy'
- '--entrypoints.web.address=:80'
- '--entrypoints.websecure.address=:443'
- '--entrypoints.http.http.redirections.entrypoint.to=https'
- '--entrypoints.http.http.redirections.entrypoint.scheme=https'
#- '--entrypoints.http.http.redirections.entrypoint.permanent=true'
- '--entrypoints.https=true'
- '--log=true'
- '--log.level=DEBUG'
cms-postgresql:
restart: unless-stopped
image: 'bitnami/postgresql:latest'
environment:
- POSTGRESQL_USERNAME=ssupat_user
- POSTGRESQL_PASSWORD=password
- POSTGRESQL_DATABASE=ssupat_cms
#- POSTGRESQL_ENABLE_TLS=yes
#- POSTGRESQL_TLS_CERT_FILE=/opt/bitnami/postgresql/certs/certs.crt
#- POSTGRESQL_TLS_KEY_FILE=/opt/bitnami/postgresql/certs/private.key
#- POSTGRESQL_TLS_CA_FILE=/opt/bitnami/postgresql/certs/ssupat.sk.ca
ports:
- '5432'
networks:
- ssupat
volumes:
- ./db/:/bitnami/postgresql
#- ./certs/traefik-certs/certs:/opt/bitnami/postgresql/certs
#- ./pg_hba.conf:/opt/bitnami/postgresql/conf/pg_hba.conf
ssupat-cms-strapi:
restart: unless-stopped
build:
context: ssupat-cms-strapi/
dockerfile: Dockerfile
environment:
DATABASE_CLIENT: postgres
DATABASE_NAME: ssupat_cms
DATABASE_HOST: cms-postgresql
DATABASE_PORT: 5432
DATABASE_USERNAME: ssupat_user
DATABASE_PASSWORD: password
networks:
- ssupat
security_opt:
- no-new-privileges:true
volumes:
- ./app/:/srv/app
- ./public/:/public/uploads
depends_on:
- "cms-postgresql"
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.ssupat-cms-strapi.rule=Host(`cms.ssupat.sk`)'
- 'traefik.http.routers.ssupat-cms-strapi.entrypoints=websecure'
- 'traefik.http.routers.ssupat-cms-strapi.tls=true'
- 'traefik.http.routers.ssupat-cms-strapi.tls.options=default'
#- 'traefik.http.routers.ssupat-cms-strapi.middlewares=authelia#docker'
- 'traefik.http.services.ssupat-cms-strapi.loadbalancer.server.port=80'
#- 'traefik.port=80'
- 'traefik.docker.network=ssupat'
- 'traefik.http.middlewares.ssupat-cms-strapi.redirectregex.regex=^http://www.cms.ssupat.sk/(.*)'
- 'traefik.http.middlewares.ssupat-cms-strapi.redirectregex.replacement=https://cms.ssupat.sk/$${1}'
- 'traefik.http.middlewares.ssupat-cms-strapi.redirectregex.permanent=true'
ssupat-web-nextjs:
restart: unless-stopped
build:
context: ssupat-web-nextjs/
dockerfile: Dockerfile
networks:
- ssupat
security_opt:
- no-new-privileges:true
depends_on:
- "ssupat-cms-strapi"
- "cms-postgresql"
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.ssupat-web-nextjs.rule=Host(`ssupat.sk`) || Host(`www.ssupat.sk`)'
#- 'traefik.http.routers.ssupat-web-nextjs.rule=Host(`ssupat.sk`, `www.ssupat.sk`)'
- 'traefik.http.routers.ssupat-web-nextjs.entrypoints=web'
#- 'traefik.http.middlewares.force_https.redirectscheme.scheme=https
- 'traefik.http.routers.ssupat-web-nextjs-secure.rule=Host(`ssupat.sk`) || Host(`www.ssupat.sk`)'
- 'traefik.http.routers.ssupat-web-nextjs-secure.entrypoints=websecure'
- 'traefik.http.routers.ssupat-web-nextjs-secure.tls=true'
- 'traefik.http.routers.ssupat-web-nextjs-secure.tls.options=default'
- 'traefik.http.services.ssupat-web-nextjs-secure.loadbalancer.server.port=3000'
#- 'traefik.port=3000'
- 'traefik.docker.network=ssupat'
#- 'traefik.http.routers.ssupat-web-nextjs-secure.middlewares=ssupat-web-nextjs-redirect'
- 'traefik.http.middlewares.ssupat-web-nextjs-secure.redirectregex.regex=^http://ssupat.sk/(.*)'
- 'traefik.http.middlewares.ssupat-web-nextjs-secure.redirectregex.replacement="https://ssupat.sk/$${1}"'
- 'traefik.http.middlewares.ssupat-web-nextjs-secure.redirectregex.permanent=true'

I trying docker-compose script postgres connection with 2 backend spring boot application but conncetioon refuse erros

version: '3.3'
services:
#InfluxDB server
influx-db:
image: influxdb:1.8-alpine
container_name: influx-db
ports:
- 8086:8086
restart: always
volumes:
- db-data:/var/lib/influxdb
networks:
- local
#PostgreSQL Database for the application
postgresdb:
image: "postgres:12.0-alpine"
container_name: postgresdb
volumes:
- db-data:/var/lib/postgresql/data
ports:
- 5432:5432
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
restart: always
networks:
- local
#Fron-end Angular Application
fe:
build: './Frontend-Asset'
ports:
- 4201:4201
links:
- sm_abc_be
- sm_um_be
depends_on:
- sm_abc_be
- sm_um_be
networks:
- local
um_fe:
build: './Frontend-User'
ports:
- 4202:4202
links:
- sm_abc_be
- sm_um_be
depends_on:
- sm_abc_be
- sm_um_be
networks:
- local
#Back-end Spring Boot Application
sm_um_be:
build: './um_be'
ports:
- 8081:8081
restart: always
volumes:
- db-data/
links:
- postgresdb
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgresdb:5432/abcd
- SPRING_DATASOURCE_USERNAME=abc_user
- SPRING_DATASOURCE_PASSWORD=abcpassword
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
depends_on:
- postgresdb
networks:
- local
sm_am_be:
build: './am_be'
ports:
- 8082:8082
restart: always
volumes:
- db-data/
links:
- postgresdb
- influx-db
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgresdb:5432/am_uuid?currentSchema=abc
- SPRING_DATASOURCE_USERNAME=am_db_user
- SPRING_DATASOURCE_PASSWORD=abcpassword
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
depends_on:
- postgresdb
- influx-db
networks:
- local
#Volumes for DB data
volumes:
db-data:
networks:
local:
driver: bridge

NiFi 1.14.0 Docker-Compose/Cluster not working

Please help, I have issue i can't make NiFi to work in version 1.14.0 via docker-compose I have problem with TLS certificate.
I don't know how to set up ENV var so TSL works. My approach was to try to set it all up on start but i failed.
I cant find any template online or reference the only is what i can read https://nifi.apache.org/docs.html and that isnt so helpful.
version: "3.3"
services:
zookeeper:
hostname: zookeeper
container_name: zookeeper
image: 'bitnami/zookeeper:latest'
volumes:
- data_share:/data_share
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_TLS_CLIENT_ENABLE=true
- ZOO_TLS_PORT_NUMBER=3181
- 'ZOO_TLS_CLIENT_KEYSTORE_FILE=/data_share/keystore.p12'
- 'ZOO_TLS_CLIENT_KEYSTORE_PASSWORD=cef4529207f19b4881b8f0f7f51e9fa9'
- 'ZOO_TLS_CLIENT_TRUSTSTORE_FILE=/data_share/truststore.p12'
- 'ZOO_TLS_CLIENT_TRUSTSTORE_PASSWORD=2b965c3a7748a3da3c6bf71377c8f5db'
networks:
netnifi:
ipv4_address: 10.40.0.10
nifi_1:
image: apache/nifi:1.14.0
tty: true
stdin_open: true
privileged: true
ports:
- 8443:8443
volumes:
- data_share:/opt/nifi/nifi-current/conf/
environment:
- NIFI_SECURITY_NEEDCLIENTAUTH=true
- NIFI_CLUSTER_PROTOCOL_IS_SECURE=true
- NIFI_SENSITIVE_PROPS_KEY=cef4529207f19b4881b8f0f7f51e9fa9
- 'NIFI_SECURITY_KEYSTORE=/opt/nifi/nifi-current/conf/keystore.p12'
- NIFI_SECURITY_KEYPASSWD=cef4529207f19b4881b8f0f7f51e9fa9
- NIFI_SECURITY_KEYSTOREPASSWD=cef4529207f19b4881b8f0f7f51e9fa9
- NIFI_SECURITY_KEYSTORETYPE=PKCS12
- 'NIFI_SECURITY_TRUSTSTORE=/opt/nifi/nifi-current/conf/truststore.p12'
- NIFI_SECURITY_TRUSTSTORETYPE=PKCS12
- NIFI_SECURITY_TRUSTSTOREPASSWD=2b965c3a7748a3da3c6bf71377c8f5db
- SINGLE_USER_CREDENTIALS_USERNAME=admin
- SINGLE_USER_CREDENTIALS_PASSWORD=ctsBtRBKHRAx69EqUghvvgEvjnaLjFEB
- NIFI_WEB_HTTPS_PORT=8443
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:3181
- NIFI_ELECTION_MAX_WAIT=1 min
networks:
netnifi:
ipv4_address: 10.40.0.20
nifi_2:
image: apache/nifi:1.14.0
tty: true
stdin_open: true
privileged: true
ports:
- 8444:8443
volumes:
- data_share:/home/data_share
environment:
- NIFI_SECURITY_NEEDCLIENTAUTH=true
- NIFI_CLUSTER_PROTOCOL_IS_SECURE=true
- NIFI_SENSITIVE_PROPS_KEY=cef4529207f19b4881b8f0f7f51e9fa9
- 'NIFI_SECURITY_KEYSTORE=/home/data_share/keystore.p12'
- NIFI_SECURITY_KEYPASSWD=cef4529207f19b4881b8f0f7f51e9fa9
- NIFI_SECURITY_KEYSTOREPASSWD=cef4529207f19b4881b8f0f7f51e9fa9
- NIFI_SECURITY_KEYSTORETYPE=PKCS12
- 'NIFI_SECURITY_TRUSTSTORE=/home/data_share/truststore.p12'
- NIFI_SECURITY_TRUSTSTORETYPE=PKCS12
- NIFI_SECURITY_TRUSTSTOREPASSWD=2b965c3a7748a3da3c6bf71377c8f5db
- SINGLE_USER_CREDENTIALS_USERNAME=admin
- SINGLE_USER_CREDENTIALS_PASSWORD=ctsBtRBKHRAx69EqUghvvgEvjnaLjFEB
- NIFI_WEB_HTTPS_PORT=8443
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:3181
- NIFI_ELECTION_MAX_WAIT=1 min
networks:
netnifi:
ipv4_address: 10.40.0.30
nifi_3:
image: apache/nifi:1.14.0
tty: true
stdin_open: true
privileged: true
ports:
- 8445:8443
volumes:
- data_share:/home/data_share
environment:
- NIFI_SECURITY_NEEDCLIENTAUTH=true
- NIFI_CLUSTER_PROTOCOL_IS_SECURE=true
- NIFI_SENSITIVE_PROPS_KEY=cef4529207f19b4881b8f0f7f51e9fa9
- 'NIFI_SECURITY_KEYSTORE=/home/data_share/keystore.p12'
- NIFI_SECURITY_KEYPASSWD=cef4529207f19b4881b8f0f7f51e9fa9
- NIFI_SECURITY_KEYSTOREPASSWD=cef4529207f19b4881b8f0f7f51e9fa9
- NIFI_SECURITY_KEYSTORETYPE=PKCS12
- 'NIFI_SECURITY_TRUSTSTORE=/home/data_share/truststore.p12'
- NIFI_SECURITY_TRUSTSTORETYPE=PKCS12
- NIFI_SECURITY_TRUSTSTOREPASSWD=2b965c3a7748a3da3c6bf71377c8f5db
- SINGLE_USER_CREDENTIALS_USERNAME=admin
- SINGLE_USER_CREDENTIALS_PASSWORD=ctsBtRBKHRAx69EqUghvvgEvjnaLjFEB
- NIFI_WEB_HTTPS_PORT=8443
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:3181
- NIFI_ELECTION_MAX_WAIT=1 min
networks:
netnifi:
ipv4_address: 10.40.0.40
networks:
netnifi:
driver: bridge
ipam:
config:
- subnet: 10.40.0.0/24
volumes:
data_share:
and for version 1.13.2 next docker-compose works perfectly
# maintainer="alex"
# repo="N/A"
# version="v.0.0.1"
# description="OWASP Lesson 1"
version: "3.3"
services:
zookeeper:
hostname: zookeeper
container_name: zookeeper
image: 'bitnami/zookeeper:latest'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
networks:
netnifi:
ipv4_address: 10.40.0.10
nifi_1:
image: apache/nifi:1.13.2
tty: true
stdin_open: true
privileged: true
ports:
- 8442:8080
volumes:
- data_share:/home/data_share
environment:
- NIFI_WEB_HTTP_PORT=8080
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:2181
- NIFI_ELECTION_MAX_WAIT=1 min
networks:
netnifi:
ipv4_address: 10.40.0.20
nifi_2:
image: apache/nifi:1.13.2
tty: true
stdin_open: true
privileged: true
ports:
- 8443:8080
volumes:
- data_share:/home/data_share
environment:
- NIFI_WEB_HTTP_PORT=8080
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:2181
- NIFI_ELECTION_MAX_WAIT=1 min
networks:
netnifi:
ipv4_address: 10.40.0.30
nifi_3:
image: apache/nifi:1.13.2
tty: true
stdin_open: true
privileged: true
ports:
- 8444:8080
volumes:
- data_share:/home/data_share
environment:
- NIFI_WEB_HTTP_PORT=8080
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:2181
- NIFI_ELECTION_MAX_WAIT=1 min
networks:
netnifi:
ipv4_address: 10.40.0.40
networks:
netnifi:
driver: bridge
ipam:
config:
- subnet: 10.40.0.0/24
volumes:
data_share:

Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp

I am learning to create an application using Hyperledger fabrics.
Created the network. I got an error when starting the network.
When I run command: docker-compose -f ./docker-compose.yml up
Getting error:
Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: could not load a valid signer certificate from directory /etc/hyperledger/fabric/msp/signcerts: stat /etc/hyperledger/fabric/msp/signcerts: no such file or directory
I have already added the CORE_PEER_MSPCONFIGPATH property in CLI service #docker-compose.yml file
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/msp
This is my docker-compose.yml file.
version: '2'
volumes:
orderer.pharma-network.com:
peer0.manufacturer.pharma-network.com:
peer1.manufacturer.pharma-network.com:
peer0.distributor.pharma-network.com:
peer1.distributor.pharma-network.com:
peer0.retailer.pharma-network.com:
peer1.retailer.pharma-network.com:
peer0.consumer.pharma-network.com:
peer1.consumer.pharma-network.com:
peer0.transporter.pharma-network.com:
peer1.transporter.pharma-network.com:
networks:
pharma:
services:
ca.manufacturer.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.manufacturer.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
#- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.manufacturer.pharma-network.com-cert.pem
#- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/754fccf4ad3f6a483161cf597b79fbdbdadaf1ee2f024e79da8c8e9b8bfb6dcb_sk
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.registrar.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/754fccf4ad3f6a483161cf597b79fbdbdadaf1ee2f024e79da8c8e9b8bfb6dcb_sk
volumes:
- ./crypto-config/peerOrganizations/manufacturer.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.manufacturer.pharma-network.com
networks:
- pharma
ca.distributor.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.distributor.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
# - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem
# - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
ports:
- "8054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/distributor.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.distributor.pharma-network.com
networks:
- pharma
ca.retailer.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.retailer.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
# - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem
# - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
ports:
- "9054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/retailer.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.retailer.pharma-network.com
networks:
- pharma
ca.consumer.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.consumer.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
ports:
- "1054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/consumer.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.consumer.pharma-network.com
networks:
- pharma
ca.transporter.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.transporter.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
# - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem
# - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
ports:
- "2054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/transporter.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.transporter.pharma-network.com
networks:
- pharma
orderer.pharma-network.com:
extends:
file: docker-base/docker-compose-base.yaml
service: orderer.pharma-network.com
container_name: orderer.pharma-network.com
networks:
- pharma
peer0.manufacturer.pharma-network.com:
container_name: peer0.manufacturer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.manufacturer.pharma-network.com
networks:
- pharma
peer1.manufacturer.pharma-network.com:
container_name: peer1.manufacturer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.manufacturer.pharma-network.com
networks:
- pharma
peer0.distributor.pharma-network.com:
container_name: peer0.distributor.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.distributor.pharma-network.com
networks:
- pharma
peer1.distributor.pharma-network.com:
container_name: peer1.distributor.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.distributor.pharma-network.com
networks:
- pharma
peer0.retailer.pharma-network.com:
container_name: peer0.retailer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.retailer.pharma-network.com
networks:
- pharma
peer1.retailer.pharma-network.com:
container_name: peer1.retailer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.retailer.pharma-network.com
networks:
- pharma
peer0.consumer.pharma-network.com:
container_name: peer0.consumer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.consumer.pharma-network.com
networks:
- pharma
peer1.consumer.pharma-network.com:
container_name: peer1.consumer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.consumer.pharma-network.com
networks:
- pharma
peer0.transporter.pharma-network.com:
container_name: peer0.transporter.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.transporter.pharma-network.com
networks:
- pharma
peer1.transporter.pharma-network.com:
container_name: peer1.transporter.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.transporter.pharma-network.com
networks:
- pharma
cli:
container_name: cli
image: hyperledger/fabric-tools:latest
tty: true
stdin_open: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/msp
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/hyperledger/fabric/peer/chaincode/
- ./../chaincode-advanced/:/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode-advanced/
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
depends_on:
- ca.manufacturer.pharma-network.com
- ca.distributor.pharma-network.com
- ca.retailer.pharma-network.com
- ca.consumer.pharma-network.com
- ca.transporter.pharma-network.com
- orderer.pharma-network.com
- peer0.manufacturer.pharma-network.com
- peer1.manufacturer.pharma-network.com
- peer0.distributor.pharma-network.com
- peer1.distributor.pharma-network.com
- peer0.retailer.pharma-network.com
- peer1.retailer.pharma-network.com
- peer0.consumer.pharma-network.com
- peer1.consumer.pharma-network.com
- peer0.transporter.pharma-network.com
- peer1.transporter.pharma-network.com
networks:
- pharma
chaincode:
container_name: chaincode
image: hyperledger/fabric-ccenv:latest
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=chaincode
- CORE_PEER_ADDRESS=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/msp
- CORE_TLS_CLIENT_KEY_PATH=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/tls/client.key
- CORE_TLS_CLIENT_CERT_PATH=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/tls/client.crt
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/tls/ca.crt
working_dir: /opt/gopath/src/chaincode
command: /bin/bash -c 'sleep 6000000'
volumes:
- /var/run/:/host/var/run/
- ./../chaincode:/opt/gopath/src/chaincode
- ./../chaincode-advanced:/opt/gopath/src/chaincode-advanced
- ./crypto-config:/opt/gopath/src/crypto
networks:
- pharma
This is docker-compose-base.yaml.
services:
orderer.pharma-network.com:
container_name: orderer.pharma-network.com
image: hyperledger/fabric-orderer:latest
environment:
- FABRIC_LOGGING_SPEC=INFO
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enable TLS
- ORDERER_GENERAL_TLS_ENABLED=false
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
#- GODEBUG=netdns=go
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ../crypto-config/ordererOrganizations/pharma-network.com/orderers/orderer.pharma-network.com/msp:/var/hyperledger/orderer/msp
- ../crypto-config/ordererOrganizations/pharma-network.com/orderers/orderer.pharma-network.com/tls/:/var/hyperledger/orderer/tls
- orderer.pharma-network.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer0.manufacturer.pharma-network.com:
container_name: peer0.manufacturer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.manufacturer.pharma-network.com
- CORE_PEER_ADDRESS=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0.manufacturer.pharma-network.com:7053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7053
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.manufacturer.pharma-network.com:8051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.manufacturer.pharma-network.com:/var/hyperledger/production
ports:
- 7051:7051
- 7053:7053
peer1.manufacturer.pharma-network.com:
container_name: peer1.manufacturer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.manufacturer.pharma-network.com
- CORE_PEER_ADDRESS=peer1.manufacturer.pharma-network.com:8051
- CORE_PEER_LISTENADDRESS=0.0.0.0:8051
- CORE_PEER_CHAINCODEADDRESS=peer0.manufacturer.pharma-network.com:8053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:8053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.manufacturer.pharma-network.com:8051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer1.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer1.manufacturer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.manufacturer.pharma-network.com:/var/hyperledger/production
ports:
- 8051:8051
- 8053:8053
peer0.distributor.pharma-network.com:
container_name: peer0.distributor.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.distributor.pharma-network.com
- CORE_PEER_ADDRESS=peer0.distributor.pharma-network.com:9051
- CORE_PEER_LISTENADDRESS=0.0.0.0:9051
- CORE_PEER_CHAINCODEADDRESS=peer0.distributor.pharma-network.com:9053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:9053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.distributor.pharma-network.com:9051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.distributor.pharma-network.com:10051
- CORE_PEER_LOCALMSPID=distributorMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer0.distributor.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer0.distributor.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.distributor.pharma-network.com:/var/hyperledger/production
ports:
- 9051:9051
- 9053:9053
peer1.distributor.pharma-network.com:
container_name: peer1.distributor.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.distributor.pharma-network.com
- CORE_PEER_ADDRESS=peer1.distributor.pharma-network.com:10051
- CORE_PEER_LISTENADDRESS=0.0.0.0:10051
- CORE_PEER_CHAINCODEADDRESS=peer0.distributor.pharma-network.com:10053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:10053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.distributor.pharma-network.com:10051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.distributor.pharma-network.com:9051
- CORE_PEER_LOCALMSPID=distributorMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer1.distributor.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer1.distributor.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.distributor.pharma-network.com:/var/hyperledger/production
ports:
- 10051:10051
- 10053:10053
peer0.retailer.pharma-network.com:
container_name: peer0.retailer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.retailer.pharma-network.com
- CORE_PEER_ADDRESS=peer0.retailer.pharma-network.com:11051
- CORE_PEER_LISTENADDRESS=0.0.0.0:11051
- CORE_PEER_CHAINCODEADDRESS=peer0.retailer.pharma-network.com:11053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.retailer.pharma-network.com:11051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.retailer.pharma-network.com:9051
- CORE_PEER_LOCALMSPID=retailerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.retailer.pharma-network.com:/var/hyperledger/production
ports:
- 11051:11051
- 11053:11053
peer1.retailer.pharma-network.com:
container_name: peer1.retailer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.retailer.pharma-network-network.com
- CORE_PEER_ADDRESS=peer1.retailer.pharma-network-network.com:11051
- CORE_PEER_LISTENADDRESS=0.0.0.0:11051
- CORE_PEER_CHAINCODEADDRESS=peer0.retailer.pharma-network-network.com:11053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.retailer.pharma-network-network.com:11051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.retailer.pharma-network.com:12051
- CORE_PEER_LOCALMSPID=upgradMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.retailer.pharma-network.com:/var/hyperledger/production
ports:
- 12051:12051
- 12053:12053
peer0.consumer.pharma-network.com:
container_name: peer0.consumer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.consumer.pharma-network.com
- CORE_PEER_ADDRESS=peer0.consumer.pharma-network.com:12051
- CORE_PEER_LISTENADDRESS=0.0.0.0:12051
- CORE_PEER_CHAINCODEADDRESS=peer0.consumer.pharma-network.com:12053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:12053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.consumer.pharma-network.com:12051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.consumer.pharma-network.com:11051
- CORE_PEER_LOCALMSPID=consumerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer0.consumer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer0.consumer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.consumer.pharma-network.com:/var/hyperledger/production
ports:
- 13051:13051
- 13053:13053
peer1.consumer.pharma-network.com:
container_name: peer1.consumer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.consumer.pharma-network.com
- CORE_PEER_ADDRESS=peer1.consumer.pharma-network.com:12052
- CORE_PEER_LISTENADDRESS=0.0.0.0:12052
- CORE_PEER_CHAINCODEADDRESS=peer1.consumer.pharma-network.com:12054
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:12054
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.consumer.pharma-network.com:12052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.consumer.pharma-network.com:11052
- CORE_PEER_LOCALMSPID=consumerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer1.consumer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer1.consumer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.consumer.pharma-network.com:/var/hyperledger/production
ports:
- 14052:14052
- 14054:14054
peer0.transporter.pharma-network.com:
container_name: peer0.transporter.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.transporter.pharma-network.com
- CORE_PEER_ADDRESS=peer0.transporter.pharma-network.com:15051
- CORE_PEER_LISTENADDRESS=0.0.0.0:15051
- CORE_PEER_CHAINCODEADDRESS=peer0.transporter.pharma-network.com:15053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:15053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.transporter.pharma-network.com:15051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.transporter.pharma-network.com:16051
- CORE_PEER_LOCALMSPID=transporterMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer0.transporter.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer0.transporter.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.transporter.pharma-network.com:/var/hyperledger/production
ports:
- 15051:15051
- 15053:15053
peer1.transporter.pharma-network.com:
container_name: peer1.transporter.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.transporter.pharma-network.com
- CORE_PEER_ADDRESS=peer1.transporter.pharma-network.com:16051
- CORE_PEER_LISTENADDRESS=0.0.0.0:16051
- CORE_PEER_CHAINCODEADDRESS=peer1.transporter.pharma-network.com:16053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:16053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.transporter.pharma-network.com:16051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.transporter.pharma-network.com:15051
- CORE_PEER_LOCALMSPID=transporterMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer1.transporter.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer1.transporter.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.transporter.pharma-network.com:/var/hyperledger/production
ports:
- 16051:16051
- 16053:16053
This is docker-compose-peer.yaml.
services:
peer-base:
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=network_pharma #changed this from network_certification
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
volumes:
- ../crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start --peer-chaincodedev=true
Please help me.
I think you need you change ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp to ./crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp. This thing totally depends on your directory structure

configure traefik as reverse proxy with docker

I am trying to configure traefik to connect between my 3 docker containers.
I tried with this configuration but I got net::ERR_NAME_NOT_RESOLVED on my browser console.
searchservice:
hostname: searchservice
image: searchservice:0.0.3-SNAPSHOT
container_name: searchservice
networks:
- es-network
#ipv4_address: 172.21.0.12
ports:
- 8070:8080
restart: always
depends_on:
- elasticsearch
- reverseproxy
labels:
- "traefik.frontend.rule=PathPrefix:/searchservice,Host:localhost"
- "traefik.port: 8070"
- "traefik.enable=true"
subscriber-service:
hostname: subscriber-service
image: subscriberservice:0.0.4-SNAPSHOT
container_name: subscriber-service
networks:
- es-network
#ipv4_address: 172.21.0.13
ports:
- 8090:8090
restart: always
depends_on:
- mongo1
- mongo2
- reverseproxy
labels:
- "traefik.frontend.rule=PathPrefix:/api,Host:localhost"
- "traefik.port: 8090"
- "traefik.enable=true"
searchappfront:
hostname: searchappfront
image: frontservice:latest
container_name: searchappfront
networks:
- es-network
ports:
- 80:80
restart: always
depends_on:
- subscriber-service
- searchservice
- reverseproxy
labels:
- "traefik.frontend.rule=PathPrefix:/"
- "traefik.enable=true"
- "traefik.port=80"
# - "traefik.frontend.rule=Host:localhost"
reverseproxy:
image: traefik:v2.1
command:
- '--providers.docker=true'
- '--entryPoints.web.address=:80'
- '--providers.providersThrottleDuration=2s'
- '--providers.docker.watch=true'
- '--providers.docker.defaultRule=Host("local.me")'
- '--accessLog.bufferingSize=0'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
#ports:
# - '80:80'
# - '8080:8080'
The searchappfront is an angular application where the http endPoints have this pattern
http://subscriber-service:8090/
http://searchservice:8070/
if I use localhost instead of hostnames, requests work fine but I need to deploy these containers in a cloud instance.
You are using traefik 2, but your annotation is for traefik 1. This is not going to work.

Resources