-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rest): add docker and postgres sample
Signed-off-by: Timo Glastra <timo@animo.id>
- Loading branch information
1 parent
ee41acc
commit 0a2d557
Showing
3 changed files
with
59 additions
and
3 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,47 @@ | ||
version: '3.8' | ||
|
||
volumes: | ||
postgres: | ||
|
||
services: | ||
credo: | ||
image: ghcr.io/openwallet-foundation/credo-rest:0.10.0 | ||
depends_on: | ||
- postgres | ||
ports: | ||
# Admin API | ||
- 3000:3000 | ||
|
||
# DIDComm | ||
- 5000:5000 | ||
- 5001:5001 | ||
|
||
# Use the local config file in the container | ||
volumes: | ||
- ./cliConfig.json:/cliConfig.json | ||
command: ['--config', '/cliConfig.json'] | ||
|
||
# This dynamically loads the wallet id, wallet key and agent endpoint (so you can use ngrok) | ||
# you also want to dynamically inject postgres connection details in prod | ||
env_file: | ||
- path: docker.env.local | ||
required: true | ||
|
||
environment: | ||
# Configure credo to use postgres as storage | ||
CREDO_REST_POSTGRES_HOST: postgres:5432 | ||
CREDO_REST_POSTGRES_USERNAME: postgres | ||
CREDO_REST_POSTGRES_PASSWORD: postgres | ||
CREDO_REST_STORAGE_TYPE: postgres | ||
|
||
# Postgres (when deploying you probably want to use a managed service for this) | ||
postgres: | ||
image: postgres:15-alpine | ||
ports: | ||
- '5432:5432' | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DATABASE: postgres | ||
volumes: | ||
- postgres:/var/lib/postgresql/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,11 @@ | ||
CREDO_REST_WALLET_ID=your_wallet_id | ||
CREDO_REST_WALLET_KEY=your_wallet_key | ||
|
||
# You can use ngrok (ngrok http 3001) to expose your local server to the internet | ||
# and interact with Paradym and other agents. | ||
# CREDO_REST_ENDPOINT=https://d297-217-123-18-26.ngrok-free.app | ||
CREDO_REST_ENDPOINT=http://localhost:5001 | ||
|
||
# You can configure credo to send webhooks to your server | ||
# Or, during development e.g. use https://rbaskets.in/web | ||
# CREDO_REST_WEBHOOK_URL=https://webhook.site/fbcd1feb-da81-447b-8888-e34cad509143 |