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

Commit

Permalink
Fix/dockercompose (#511)
Browse files Browse the repository at this point in the history
* tune compose files
* open preview
* fix webhook url

Signed-off-by: frank-bee <[email protected]>
  • Loading branch information
frank-bee authored Jun 24, 2021
1 parent be86604 commit fc83ce1
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 141 deletions.
11 changes: 5 additions & 6 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ports:
- port: 8080
onOpen: ignore
- port: 8081
onOpen: open-browser
onOpen: open-preview
- port: 8090
onOpen: open-browser
- port: 8030
Expand All @@ -22,9 +22,7 @@ ports:
- port: 5900
onOpen: ignore
- port: 5432
onOpen: ignore
- port: 5452
onOpen: ignore
onOpen: ignore

github:
prebuilds:
Expand All @@ -50,16 +48,17 @@ tasks:
gp env ACAPY_ENDPOINT=`gp url 8030`
gp env ACAPY2_ENDPOINT=`gp url 8040`
gp env BPA_HOST=`gp url 8080 | sed 's/.*https:\/\///'`
gp env BPA_WEBHOOK_URL=`gp url 8080`/log
gp env BPA2_HOST=`gp url 8090 | sed 's/.*https:\/\///'`
eval $(gp env -e)
cd /workspace/business-partner-agent/scripts
cp .env-example .env
./register-dids.sh
docker-compose --profile second_bpa -f docker-compose.yml -f docker-compose.dev.yml build bpa2
docker-compose --profile second_bpa build bpa2
command: |
cd /workspace/business-partner-agent/scripts
eval $(gp env -e)
docker-compose --profile second_bpa -f docker-compose.yml -f docker-compose.dev.yml up bpa-agent1 bpa2
docker-compose --profile second_bpa up bpa-agent1 bpa2
# Backend: for "BPA" launch the backend via java (without frontend). To allow debugging easily.
- name: dev backend
init: |
Expand Down

This file was deleted.

4 changes: 3 additions & 1 deletion scripts/.env-example
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ BPA_HOST=localhost
BPA2_HOST=localhost
BPA_PORT=8080
BPA2_PORT=8090
BPA_WEBHOOK_URL=http://bpa1:8080/log
BPA2_WEBHOOK_URL=http://bpa2:8080/log

BPA_DEBUG_PORT=1044
BPA_DEBUG_PORT=1045

BPA_SCHEME=http
BPA_SCHEME=https
BPA_CONFIG_FILES=classpath:application.yml,classpath:schemas.yml

# Security
Expand Down
80 changes: 6 additions & 74 deletions scripts/docker-compose.custom-acapy.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,10 @@
# Compose file for frontent developers or for everyone else that needs the full stack up and running

version: '3'

version: "3.9"
services:
bpa:
image: ${BPA_DOCKER_IMAGE}
depends_on:
- aca-py
environment:
JAVA_OPTS: >
-Dbpa.acapy.url=http://aca-py:${ACAPY_ADMIN_PORT}
-Dbpa.acapy.apiKey=${ACAPY_ADMIN_URL_API_KEY}
-Dmicronaut.security.enabled=${BPA_SECURITY_ENABLED}
-Dmicronaut.server.port=${BPA_PORT}
-Dmicronaut.config.files=${BPA_CONFIG_FILES}
-Dbpa.pg.url=jdbc:postgresql://${POSTGRESQL_HOST}/${POSTGRESQL_USER}
-Dbpa.pg.username=${POSTGRESQL_USER}
-Dbpa.pg.password=${POSTGRESQL_PASSWORD}
-Dbpa.host=${BPA_HOST}
BPA_WEB_MODE: ${BPA_WEB_MODE}
BPA_RESOLVER_URL: ${BPA_RESOLVER_URL}
BPA_LEDGER_BROWSER: ${BPA_LEDGER_BROWSER}
BPA_DID_PREFIX: ${BPA_DID_PREFIX}
BPA_BOOTSTRAP_UN: ${BPA_BOOTSTRAP_UN}
BPA_BOOTSTRAP_PW: ${BPA_BOOTSTRAP_PW}
ACAPY_ENDPOINT: ${ACAPY_ENDPOINT}
AGENT_NAME: ${AGENT_NAME}
BPA_IMPRINT_URL: ${BPA_IMPRINT_URL}
BPA_PRIVACY_POLICY_URL: ${BPA_PRIVACY_POLICY_URL}
BPA_CREDDEF_REVOCATION_REGISTRY_SIZE: ${BPA_CREDDEF_REVOCATION_REGISTRY_SIZE}
ports:
- ${BPA_PORT}:${BPA_PORT}
restart: always
aca-py:
bpa-agent1:
build:
context: ${ACAPY_BUILD_CONTEXT}
dockerfile: ${ACAPY_BUILD_DOCKERFILE_PATH}
ports:
- ${ACAPY_ADMIN_PORT}:${ACAPY_ADMIN_PORT}
- ${ACAPY_HTTP_PORT}:${ACAPY_HTTP_PORT}
depends_on:
- postgres
entrypoint: /bin/bash
command: [
"-c",
"sleep 1;
aca-py start \
--arg-file acapy-static-args.yml \
--inbound-transport http '0.0.0.0' ${ACAPY_HTTP_PORT} \
--webhook-url http://bpa:${BPA_PORT}/log \
--genesis-url '${ACAPY_GENESIS_URL}' \
--endpoint ${ACAPY_ENDPOINT} \
--wallet-name '${ACAPY_WALLET_DATABASE}' \
--wallet-key '${ACAPY_WALLET_ENCRYPTION_KEY}' \
--wallet-storage-type '${ACAPY_WALLET_TYPE}' \
--wallet-storage-config '{\"url\":\"${POSTGRESQL_HOST}:${POSTGRESQL_PORT}\",\"max_connections\":5}' \
--wallet-storage-creds '{\"account\":\"${POSTGRESQL_USER}\",\"password\":\"${POSTGRESQL_PASSWORD}\",\"admin_account\":\"${POSTGRESQL_USER}\",\"admin_password\":\"${POSTGRESQL_PASSWORD}\"}' \
--seed '${ACAPY_SEED}' \
--admin '0.0.0.0' ${ACAPY_ADMIN_PORT} \
--label '${AGENT_NAME}' \
${ACAPY_ADMIN_CONFIG} \
${ACAPY_READ_ONLY_MODE} \
"
]
volumes:
- "./acapy-static-args.yml:/home/indy/acapy-static-args.yml"
postgres:
image: "postgres:12-alpine"
environment:
- POSTGRES_USER=${POSTGRESQL_USER}
- POSTGRES_PASSWORD=${POSTGRESQL_PASSWORD}
ports:
- ${POSTGRESQL_PORT}:${POSTGRESQL_PORT}
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
postgres-data:
bpa-agent2:
build:
context: ${ACAPY_BUILD_CONTEXT}
dockerfile: ${ACAPY_BUILD_DOCKERFILE_PATH}
47 changes: 0 additions & 47 deletions scripts/docker-compose.dev.yml

This file was deleted.

19 changes: 19 additions & 0 deletions scripts/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3.9"
services:
#######
# Business Partner 1
#######
bpa1:
image: ghcr.io/hyperledger-labs/business-partner-agent:local
build:
context: ..
dockerfile: Dockerfile

#######
# Business Partner 2 (only started with "--profile second_bpa")
#######
bpa2:
image: ghcr.io/hyperledger-labs/business-partner-agent:local
build:
context: ..
dockerfile: Dockerfile
26 changes: 16 additions & 10 deletions scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ services:
#######
# Business Partner 1
#######
BPA:
image: ${BPA_DOCKER_IMAGE}
bpa1:
image: ghcr.io/hyperledger-labs/business-partner-agent:edge
build:
context: ""
dockerfile: ""
depends_on:
- bpa-agent1
environment:
Expand All @@ -17,7 +20,7 @@ services:
-Dbpa.pg.url=jdbc:postgresql://${POSTGRESQL_HOST}/${POSTGRESQL_USER}
-Dbpa.pg.username=${POSTGRESQL_USER}
-Dbpa.pg.password=${POSTGRESQL_PASSWORD}
-Dbpa.host=${BPA_HOST}:${BPA_PORT}
-Dbpa.host=${BPA_HOST}
-Dbpa.scheme=${BPA_SCHEME}
BPA_WEB_MODE: ${BPA_WEB_MODE}
BPA_RESOLVER_URL: ${BPA_RESOLVER_URL}
Expand Down Expand Up @@ -48,7 +51,7 @@ services:
--auto-provision
--arg-file acapy-static-args.yml \
--inbound-transport http '0.0.0.0' ${ACAPY_HTTP_PORT} \
--webhook-url http://BPA:${BPA_PORT}/log \
--webhook-url '${BPA_WEBHOOK_URL}' \
--genesis-url '${ACAPY_GENESIS_URL}' \
--endpoint ${ACAPY_ENDPOINT} \
--wallet-name '${ACAPY_WALLET_DATABASE}' \
Expand Down Expand Up @@ -81,7 +84,10 @@ services:
bpa2:
profiles:
- second_bpa
image: ${BPA_DOCKER_IMAGE}
image: ghcr.io/hyperledger-labs/business-partner-agent:edge
build:
context: ""
dockerfile: ""
depends_on:
- bpa-agent2
environment:
Expand All @@ -94,7 +100,7 @@ services:
-Dbpa.pg.url=jdbc:postgresql://${POSTGRESQL2_HOST}/${POSTGRESQL_USER}
-Dbpa.pg.username=${POSTGRESQL_USER}
-Dbpa.pg.password=${POSTGRESQL_PASSWORD}
-Dbpa.host=${BPA2_HOST}:${BPA2_PORT}
-Dbpa.host=${BPA2_HOST}
-Dbpa.scheme=${BPA_SCHEME}
BPA_WEB_MODE: ${BPA_WEB_MODE}
BPA_RESOLVER_URL: ${BPA_RESOLVER_URL}
Expand Down Expand Up @@ -127,7 +133,7 @@ services:
--auto-provision
--arg-file acapy-static-args.yml \
--inbound-transport http '0.0.0.0' ${ACAPY2_HTTP_PORT} \
--webhook-url http://bpa2:${BPA2_PORT}/log \
--webhook-url '${BPA2_WEBHOOK_URL}' \
--genesis-url '${ACAPY_GENESIS_URL}' \
--endpoint ${ACAPY2_ENDPOINT} \
--wallet-name '${ACAPY_WALLET_DATABASE}' \
Expand Down Expand Up @@ -155,9 +161,9 @@ services:
- ${POSTGRESQL2_PORT}:5432
volumes:
- bpa-wallet-db2:/var/lib/postgresql/data



#######
# Volumes for the databases
#######
volumes:
bpa-wallet-db1:
bpa-wallet-db2:

0 comments on commit fc83ce1

Please sign in to comment.