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) Start a Redis server (Redis is used to store the queue of submit transactions)
```shell ```shell
export REDIS_PASSWORD=$(uuidgen)
npm run start:redis 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 Start the sample REST server and Redis server
```shell ```shell
export REDIS_PASSWORD=$(uuidgen)
docker-compose up -d docker-compose up -d
``` ```

View file

@ -3,6 +3,7 @@ version: '3'
services: services:
redis: redis:
image: 'redis' image: 'redis'
command: ['--maxmemory-policy','noeviction','--requirepass','${REDIS_PASSWORD}']
ports: ports:
- 6379:6379 - 6379:6379
networks: networks:
@ -15,6 +16,8 @@ services:
- 3000:3000 - 3000:3000
env_file: env_file:
- ./.env - ./.env
environment:
- REDIS_PASSWORD
networks: networks:
- fabric_test - fabric_test

View file

@ -58,7 +58,7 @@
"start": "node --require source-map-support/register ./dist", "start": "node --require source-map-support/register ./dist",
"start:dotenv": "node --require source-map-support/register --require dotenv/config ./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: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" "test": "jest"
}, },
"author": "Hyperledger", "author": "Hyperledger",