-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(): init mediator integration environment setup
- Loading branch information
1 parent
c7d7ea9
commit 2b0ad66
Showing
4 changed files
with
88 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM rust:latest as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
# Build the server | ||
RUN cargo build --release | ||
|
||
# Use a minimal image for running the server | ||
FROM ubuntu | ||
|
||
RUN apt update && apt install -y libpq5 | ||
WORKDIR /app | ||
|
||
|
||
# Copy the built binary | ||
COPY --from=builder /app/target/release/didcomm-mediator /usr/local/bin/didcomm-mediator | ||
|
||
# Expose the necessary port | ||
EXPOSE 8080 | ||
|
||
# Run the server | ||
CMD ["didcomm-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,25 @@ | ||
version: '3.8' | ||
services: | ||
mediator: | ||
build: | ||
context: . | ||
container_name: didcomm-mediator | ||
ports: | ||
- "8080:3000" | ||
env_file: | ||
- .env | ||
depends_on: | ||
- mongodb | ||
|
||
mongodb: | ||
image: mongo:latest | ||
container_name: mongodb | ||
ports: | ||
- "27017:27017" | ||
env_file: | ||
- .env | ||
volumes: | ||
- mongo-data:/data/db | ||
|
||
volumes: | ||
mongo-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,38 @@ | ||
# DIDComm Mediator Integration Environment Setup | ||
|
||
This guide provides step-by-step instructions to set up the integration environment for deploying, testing, and interacting with the Rust-based DIDComm mediator server. | ||
|
||
## Prerequisites | ||
Before you begin, ensure the following are installed on your system: | ||
- Docker: version 20+([install docker](https://docs.docker.com/engine/install/debian/)) | ||
- Rust: latest stable version ([install rust](https://www.rust-lang.org/tools/install)) | ||
- MongoDB: latest stable version ([install mongodb](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/)) | ||
|
||
This documentation assumes you have clone the [mediator](https://github.com/adorsys/didcomm-mediator-rs) and are in the root of the project | ||
|
||
## step 1: Setup the environment variables | ||
Modify the ```.env``` file with the right values for the variables | ||
|
||
## Step 2: Start The Environment | ||
|
||
```sh | ||
docker-compose up -d | ||
``` | ||
## Step 3: Test Connectivity | ||
Use a tool like Postman or curl to verify that the server is running and responding. | ||
```sh | ||
curl -X GET http://0.0.0.0:8080/ \ | ||
-H "Content-Type: application/json" \ | ||
``` | ||
|
||
## Step 4: Logging And Monitoring | ||
to monitor the logs run the command | ||
```sh | ||
docker logs -f didcomm-mediator | ||
``` | ||
|
||
## Step 5: Cleanup | ||
To Stop and remove the environment | ||
```sh | ||
docker-compose down | ||
``` |
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