Update REST sample with Redis password (#629)

Signed-off-by: James Taylor <jamest@uk.ibm.com>
This commit is contained in:
James Taylor 2022-02-04 14:27:40 +00:00 committed by GitHub
parent 5edae7c444
commit e7074ba941
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -121,6 +121,7 @@ TEST_NETWORK_HOME=$HOME/fabric-samples/test-network npm run generateEnv
Start a Redis server (Redis is used to store the queue of submit transactions)
```shell
export REDIS_PASSWORD=$(uuidgen)
npm run start:redis
```
@ -147,6 +148,7 @@ TEST_NETWORK_HOME=$HOME/fabric-samples/test-network AS_LOCAL_HOST=false npm run
Start the sample REST server and Redis server
```shell
export REDIS_PASSWORD=$(uuidgen)
docker-compose up -d
```

View file

@ -3,6 +3,7 @@ version: '3'
services:
redis:
image: 'redis'
command: ['--maxmemory-policy','noeviction','--requirepass','${REDIS_PASSWORD}']
ports:
- 6379:6379
networks:
@ -12,9 +13,11 @@ services:
image: 'ghcr.io/hyperledger/fabric-rest-sample:latest'
command: ['start:dotenv']
ports:
- 3000:3000
- 3000:3000
env_file:
- ./.env
- ./.env
environment:
- REDIS_PASSWORD
networks:
- fabric_test

View file

@ -58,7 +58,7 @@
"start": "node --require source-map-support/register ./dist",
"start:dotenv": "node --require source-map-support/register --require dotenv/config ./dist",
"start:dev": "node --require source-map-support/register --require dotenv/config ./dist | pino-pretty",
"start:redis": "docker run -p 6379:6379 --name fabric-sample-redis -d redis --maxmemory-policy noeviction",
"start:redis": "docker run -p 6379:6379 --name fabric-sample-redis -d redis --maxmemory-policy noeviction --requirepass \"${REDIS_PASSWORD}\"",
"test": "jest"
},
"author": "Hyperledger",