Skip to content

Commit

Permalink
Make port 8080 parameterized (hyperledger-labs#301)
Browse files Browse the repository at this point in the history
* add PORT to start.sh and .env

Signed-off-by: Jacob Kopczynski <[email protected]>

* Pull in .env when using quick start

Principally to set PORT but it makes the rest of the docker-compose work
more smoothly as well.

Signed-off-by: Jacob Kopczynski <[email protected]>

* Make docker-compose.yaml sufficient

Allow PORT to be set as envvar, but default to 8080

Signed-off-by: Jacob Kopczynski <[email protected]>
  • Loading branch information
jkopczyn authored May 12, 2022
1 parent 7a7ac14 commit f553332
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PORT=8080
EXPLORER_CONFIG_FILE_PATH=./examples/net1/config.json
EXPLORER_PROFILE_DIR_PATH=./examples/net1/connection-profile
FABRIC_CRYPTO_PATH=/fabric-path/fabric-samples/test-network/organizations
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ This guide assumes that you've already started the test network by following [Hy

* Copy the following files from the repository

- [.env](https://github.com/hyperledger/blockchain-explorer/blob/main/.env)
- [docker-compose.yaml](https://github.com/hyperledger/blockchain-explorer/blob/main/docker-compose.yaml)
- [examples/net1/connection-profile/test-network.json](https://github.com/hyperledger/blockchain-explorer/blob/main/examples/net1/connection-profile/test-network.json)
- [examples/net1/config.json](https://github.com/hyperledger/blockchain-explorer/blob/main/examples/net1/config.json)
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ volumes:

networks:
mynetwork.com:
external:
name: fabric_test
name: fabric_test

services:

Expand Down Expand Up @@ -45,13 +44,14 @@ services:
- LOG_LEVEL_CONSOLE=debug
- LOG_CONSOLE_STDOUT=true
- DISCOVERY_AS_LOCALHOST=false
- PORT=${PORT:-8080}
volumes:
- ${EXPLORER_CONFIG_FILE_PATH}:/opt/explorer/app/platform/fabric/config.json
- ${EXPLORER_PROFILE_DIR_PATH}:/opt/explorer/app/platform/fabric/connection-profile
- ${FABRIC_CRYPTO_PATH}:/tmp/crypto
- walletstore:/opt/explorer/wallet
ports:
- 8080:8080
- ${PORT:-8080}:${PORT:-8080}
depends_on:
explorerdb.mynetwork.com:
condition: service_healthy
Expand Down
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export LOG_CONSOLE_STDOUT=${LOG_CONSOLE_STDOUT:-false}

export DISCOVERY_AS_LOCALHOST=${DISCOVERY_AS_LOCALHOST:-true}
export EXPLORER_APP_ROOT=${EXPLORER_APP_ROOT:-dist}
export PORT=${PORT:-8080}

function log_exit() {
echo "Server stopped"
Expand Down

0 comments on commit f553332

Please sign in to comment.