-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mediator): Containerise and package mediator (#1139)
feat(mediator): Containerise and package mediator (#1139) Signed-off-by: Naian <126972030+nain-F49FF806@users.noreply.github.com>
- Loading branch information
1 parent
3eec389
commit 968fc69
Showing
7 changed files
with
207 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Note: This file is read by `compose.yaml` for it's environment variables. | ||
## So the services that docker-compose brings up will also use the below configuration. | ||
|
||
# Database (db) config | ||
|
||
## Root password can be autogenerated. It will be printed out on first run. | ||
MYSQL_RANDOM_ROOT_PASSWORD=true | ||
|
||
## You can set it manually if you wish. Remember to unset MYSQL_RANDOM_ROOT_PASSWORD like below. | ||
#MYSQL_RANDOM_ROOT_PASSWORD= | ||
#MYSQL_ROOT_PASSWORD=poorpasswordavoid | ||
|
||
## Name of database to create on mysql init (first run). | ||
MYSQL_DATABASE=mediator-persistence.db | ||
|
||
## User to generate on mysql init (first run). | ||
MYSQL_USER=mediator | ||
MYSQL_PASSWORD=mediator-pass | ||
|
||
|
||
# Mediator (mediator) config | ||
|
||
## Full URL that mediator can use to connect to the database. | ||
MYSQL_URL=mysql://mediator:mediator-pass@localhost:3306/mediator-persistence.db | ||
|
||
## This is the address at which the mediator will listen for connections. | ||
ENDPOINT_ROOT=0.0.0.0:8005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM rust as builder | ||
RUN apt update && apt install -y libssl-dev libzmq3-dev cmake | ||
|
||
WORKDIR /usr/src/aries-vcx | ||
COPY . . | ||
RUN ls -lahF | ||
RUN --mount=type=cache,target=./target \ | ||
--mount=type=cache,target=${CARGO_HOME}/git \ | ||
--mount=type=cache,target=${CARGO_HOME}/registry \ | ||
cargo install --no-default-features --path=./aries/agents/rust/mediator/ --bin mediator | ||
|
||
FROM debian:bookworm-slim as mediator | ||
RUN apt update && apt install -y libsodium23 libzmq5 && rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /usr/local/cargo/bin/mediator /usr/local/bin/mediator | ||
CMD ["./usr/local/bin/mediator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
services: | ||
db: | ||
image: mysql:latest | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
- ./migrations:/docker-entrypoint-initdb.d:z | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | ||
MYSQL_RANDOM_ROOT_PASSWORD: ${MYSQL_RANDOM_ROOT_PASSWORD} | ||
MYSQL_DATABASE: ${MYSQL_DATABASE} | ||
MYSQL_USER: ${MYSQL_USER} | ||
MYSQL_PASSWORD: ${MYSQL_PASSWORD} | ||
|
||
mediator: | ||
depends_on: | ||
- db | ||
image: mediator:latest | ||
ports: | ||
- "8005:8005" | ||
environment: | ||
MYSQL_URL: mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@db:3306/${MYSQL_DATABASE} | ||
ENDPOINT_ROOT: ${ENDPOINT_ROOT} | ||
|
||
volumes: | ||
db_data: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
services: | ||
db: | ||
image: mysql:latest | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
- ./migrations:/docker-entrypoint-initdb.d:z | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | ||
MYSQL_RANDOM_ROOT_PASSWORD: ${MYSQL_RANDOM_ROOT_PASSWORD} | ||
MYSQL_DATABASE: ${MYSQL_DATABASE} | ||
MYSQL_USER: ${MYSQL_USER} | ||
MYSQL_PASSWORD: ${MYSQL_PASSWORD} | ||
ports: | ||
- "3306:3306" | ||
|
||
volumes: | ||
db_data: | ||
|
||
|