Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Feature/veritable docker (#107)
Browse files Browse the repository at this point in the history
* Split compose into several files and add veritable instances

* 0.10.0

* setup script for veritable

* Fix context
  • Loading branch information
mattdean-digicatapult authored Feb 6, 2024
1 parent d529da7 commit 9229904
Show file tree
Hide file tree
Showing 11 changed files with 883 additions and 452 deletions.
432 changes: 19 additions & 413 deletions docker-compose-3-persona.yml

Large diffs are not rendered by default.

185 changes: 185 additions & 0 deletions docker/hyproof-apis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
version: '3'

services:
##################################################################################
## Heidi the Hydrogen Producer ###################################################
##################################################################################

hydrogen-producer-postgres-hyproof-api:
image: postgres:16.1-alpine
container_name: hydrogen-producer-postgres-hyproof-api
depends_on:
hydrogen-producer-node:
condition: service_healthy
volumes:
- hydrogen-producer-hyproof-api-storage:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=dscp-hyproof-api
networks: ['hydrogen-producer']

hydrogen-producer-hyproof-api:
container_name: hydrogen-producer-hyproof-api
build:
context: '../'
dockerfile: 'Dockerfile'
command: /bin/sh -c "
sleep 20 &&
npx knex migrate:latest --knexfile build/lib/db/knexfile &&
npx @digicatapult/dscp-process-management@latest create -h hydrogen-producer-node -p 9944 -u //Alice -f ./processFlows.json &&
npm start"
environment:
- PORT=8000
- LOG_LEVEL=debug
- NODE_HOST=hydrogen-producer-node
- NODE_PORT=9944
- DB_HOST=hydrogen-producer-postgres-hyproof-api
- DB_PORT=5432
- DB_NAME=dscp-hyproof-api
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- IDENTITY_SERVICE_HOST=hydrogen-producer-identity
- IDENTITY_SERVICE_PORT=9000
- IPFS_HOST=hydrogen-producer-ipfs
- IPFS_PORT=5001
- USER_URI=//Alice
- 'API_SWAGGER_BG_COLOR=#e4f2f3'
- 'API_SWAGGER_TITLE=HyProof API - Heidi'
- 'API_SWAGGER_HEADING=HyProof API - Heidi'
ports:
- 8000:8000
depends_on:
hydrogen-producer-node:
condition: service_healthy
hydrogen-producer-identity:
condition: service_started
hydrogen-producer-postgres-hyproof-api:
condition: service_started
hydrogen-producer-ipfs:
condition: service_healthy
restart: on-failure
networks: ['hydrogen-producer']

##################################################################################
## Emma the Energy Owner #########################################################
##################################################################################

energy-owner-postgres-hyproof-api:
image: postgres:16.1-alpine
container_name: energy-owner-postgres-hyproof-api
depends_on:
energy-owner-node:
condition: service_healthy
volumes:
- energy-owner-hyproof-api-storage:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=dscp-hyproof-api
networks: ['energy-owner']

energy-owner-hyproof-api:
container_name: energy-owner-hyproof-api
build:
context: '../'
dockerfile: 'Dockerfile'
command: /bin/sh -c "
sleep 10 &&
npx knex migrate:latest --knexfile build/lib/db/knexfile &&
npm start"
environment:
- PORT=8010
- LOG_LEVEL=debug
- NODE_HOST=energy-owner-node
- NODE_PORT=9944
- DB_HOST=energy-owner-postgres-hyproof-api
- DB_PORT=5432
- DB_NAME=dscp-hyproof-api
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- IDENTITY_SERVICE_HOST=energy-owner-identity
- IDENTITY_SERVICE_PORT=9010
- IPFS_HOST=energy-owner-ipfs
- IPFS_PORT=5001
- USER_URI=//Bob
- 'API_SWAGGER_BG_COLOR=#e7f6e6'
- 'API_SWAGGER_TITLE=HyProof API - Emma'
- 'API_SWAGGER_HEADING=HyProof API - Emma'
ports:
- 8010:8010
depends_on:
energy-owner-node:
condition: service_healthy
energy-owner-identity:
condition: service_started
energy-owner-postgres-hyproof-api:
condition: service_started
energy-owner-ipfs:
condition: service_healthy
restart: on-failure
networks: ['energy-owner']

##################################################################################
## Reginald the Regulator ########################################################
##################################################################################

regulator-postgres-hyproof-api:
image: postgres:16.1-alpine
container_name: regulator-postgres-hyproof-api
depends_on:
regulator-node:
condition: service_healthy
volumes:
- regulator-hyproof-api-storage:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=dscp-hyproof-api
networks: ['regulator']

regulator-hyproof-api:
container_name: regulator-hyproof-api
build:
context: '../'
dockerfile: 'Dockerfile'
command: /bin/sh -c "
sleep 10 &&
npx knex migrate:latest --knexfile build/lib/db/knexfile &&
npm start"
environment:
- PORT=8020
- LOG_LEVEL=debug
- NODE_HOST=regulator-node
- NODE_PORT=9944
- DB_HOST=regulator-postgres-hyproof-api
- DB_PORT=5432
- DB_NAME=dscp-hyproof-api
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- IDENTITY_SERVICE_HOST=regulator-identity
- IDENTITY_SERVICE_PORT=9020
- IPFS_HOST=regulator-ipfs
- IPFS_PORT=5001
- USER_URI=//Charlie
- 'API_SWAGGER_BG_COLOR=#f8dddd'
- 'API_SWAGGER_TITLE=HyProof API - Reginald'
- 'API_SWAGGER_HEADING=HyProof API - Reginald'
ports:
- 8020:8020
depends_on:
regulator-node:
condition: service_healthy
regulator-identity:
condition: service_started
regulator-postgres-hyproof-api:
condition: service_started
regulator-ipfs:
condition: service_healthy
restart: on-failure
networks: ['regulator']

volumes:
hydrogen-producer-hyproof-api-storage:
energy-owner-hyproof-api-storage:
regulator-hyproof-api-storage:
151 changes: 151 additions & 0 deletions docker/identity-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
version: '3'

services:
##################################################################################
## Heidi the Hydrogen Producer ###################################################
##################################################################################

hydrogen-producer-postgres-identity:
image: postgres:16.1-alpine
container_name: hydrogen-producer-postgres-identity
depends_on:
hydrogen-producer-node:
condition: service_healthy
volumes:
- hydrogen-producer-identity-storage:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=dscp-identity
networks: ['hydrogen-producer']

hydrogen-producer-identity:
image: digicatapult/dscp-identity-service:latest
container_name: hydrogen-producer-identity
command: /bin/sh -c "
sleep 10 &&
npx knex migrate:latest &&
node app/index.js"
ports:
- 9000:9000
depends_on:
hydrogen-producer-node:
condition: service_healthy
hydrogen-producer-postgres-identity:
condition: service_started
environment:
- PORT=9000
- API_HOST=hydrogen-producer-node
- API_PORT=9944
- DB_HOST=hydrogen-producer-postgres-identity
- DB_PORT=5432
- DB_NAME=dscp-identity
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- SELF_ADDRESS=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- AUTH_TYPE=${AUTH_TYPE:-NONE}
- 'API_SWAGGER_BG_COLOR=#e4f2f3'
- 'API_SWAGGER_TITLE=HyProof Identity API - Heidi'
- 'API_SWAGGER_HEADING=HyProof Identity API - Heidi'
networks: ['hydrogen-producer']

##################################################################################
## Emma the Energy Owner #########################################################
##################################################################################

energy-owner-postgres-identity:
image: postgres:16.1-alpine
container_name: energy-owner-postgres-identity
depends_on:
energy-owner-node:
condition: service_healthy
volumes:
- energy-owner-identity-storage:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=dscp-identity
networks: ['energy-owner']

energy-owner-identity:
image: digicatapult/dscp-identity-service:latest
container_name: energy-owner-identity
command: /bin/sh -c "
sleep 10 &&
npx knex migrate:latest &&
node app/index.js"
ports:
- 9010:9010
depends_on:
energy-owner-node:
condition: service_healthy
energy-owner-postgres-identity:
condition: service_started
environment:
- PORT=9010
- API_HOST=energy-owner-node
- API_PORT=9944
- DB_HOST=energy-owner-postgres-identity
- DB_PORT=5432
- DB_NAME=dscp-identity
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- SELF_ADDRESS=5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty
- AUTH_TYPE=${AUTH_TYPE:-NONE}
- 'API_SWAGGER_BG_COLOR=#e7f6e6'
- 'API_SWAGGER_TITLE=HyProof Identity API - Emma'
- 'API_SWAGGER_HEADING=HyProof Identity API - Emma'
networks: ['energy-owner']

##################################################################################
## Reginald the Regulator ########################################################
##################################################################################

regulator-postgres-identity:
image: postgres:16.1-alpine
container_name: regulator-postgres-identity
depends_on:
regulator-node:
condition: service_healthy
volumes:
- regulator-identity-storage:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=dscp-identity
networks: ['regulator']

regulator-identity:
image: digicatapult/dscp-identity-service:latest
container_name: regulator-identity
command: /bin/sh -c "
sleep 10 &&
npx knex migrate:latest &&
node app/index.js"
ports:
- 9020:9020
depends_on:
regulator-node:
condition: service_healthy
regulator-postgres-identity:
condition: service_started
environment:
- PORT=9020
- API_HOST=regulator-node
- API_PORT=9944
- DB_HOST=regulator-postgres-identity
- DB_PORT=5432
- DB_NAME=dscp-identity
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- SELF_ADDRESS=5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y
- AUTH_TYPE=${AUTH_TYPE:-NONE}
- 'API_SWAGGER_BG_COLOR=#f8dddd'
- 'API_SWAGGER_TITLE=HyProof Identity API - Reginald'
- 'API_SWAGGER_HEADING=HyProof Identity API - Reginald'
networks: ['regulator']

volumes:
hydrogen-producer-identity-storage:
energy-owner-identity-storage:
regulator-identity-storage:
Loading

0 comments on commit 9229904

Please sign in to comment.