Skip to content

Commit

Permalink
restructure docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
eike-hass committed Apr 30, 2024
1 parent e49d939 commit 118a833
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 56 deletions.
72 changes: 72 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
version: '3'
services:

##################################################################
# Reverse Proxy and SSL #
##################################################################

traefik:
image: traefik:v2.11
command:
- "--accesslog=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.grpc.address=:5000"
- "--log.level=DEBUG"
ports:
- "${HTTP_PORT}:80/tcp"
- "${GRPC_PORT}:5000/tcp"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"

whoami:
# A container that exposes an API to show its IP address
image: traefik/whoami
Expand All @@ -25,6 +44,11 @@ services:
- run
- start:dev
labels:
traefik.enable: true
traefik.http.routers.backend.rule: Host(`selv.local`)
traefik.http.routers.backend.entrypoints: web
traefik.http.routers.backend.service: backend
traefik.http.services.backend.loadbalancer.server.port: "3000"
traefik.http.routers.backend-grpc.rule: PathPrefix(`/backend`)
traefik.http.routers.backend-grpc.middlewares: backend-grpc-stripprefix
traefik.http.middlewares.backend-grpc-stripprefix.stripprefix.prefixes: /backend
Expand All @@ -37,6 +61,8 @@ services:
extends:
file: docker-compose.yml
service: identity
environment:
- API_ENDPOINT=http://host.docker.internal
labels:
traefik.enable: true
traefik.http.routers.identity-grpc.rule: PathPrefix(`/identity`)
Expand All @@ -51,7 +77,17 @@ services:
extends:
file: docker-compose.yml
service: oid4vc-tanglelabs
environment:
RP_DID: did:iota:snd:0x2cfb60f00089a91a96fa8fcee5e2bda15f51b0b062762ad9ca846bba536f8818
SIGNER_KEYID: pK0JAYw5RFFKqorBn0x4w98zl2UBfRys
KEY_FRAGMENT: key-1
PUBLIC_URL: "bank.selv.local"
labels:
traefik.enable: true
traefik.http.routers.oid4vc-tanglelabs.rule: Host(`bank.selv.local`)
traefik.http.routers.oid4vc-tanglelabs.entrypoints: web
traefik.http.routers.oid4vc-tanglelabs.service: oid4vc-tanglelabs
traefik.http.services.oid4vc-tanglelabs.loadbalancer.server.port: "3333"
traefik.http.routers.oid4vc-tanglelabs-grpc.rule: PathPrefix(`/oid4vc-tanglelabs`)
traefik.http.routers.oid4vc-tanglelabs-grpc.middlewares: oid4vc-tanglelabs-grpc-stripprefix
traefik.http.middlewares.oid4vc-tanglelabs-grpc-stripprefix.stripprefix.prefixes: /oid4vc-tanglelabs
Expand All @@ -60,6 +96,42 @@ services:
traefik.http.services.svc_oid4vc-tanglelabs-grpc.loadbalancer.server.port: "50051"
traefik.http.services.svc_oid4vc-tanglelabs-grpc.loadbalancer.server.scheme: h2c

oid4vc-waltid:
extends:
file: docker-compose.yml
service: oid4vc-waltid
labels:
traefik.enable: true
traefik.http.routers.oid4vc-waltid.rule: Host(`government.selv.local`)
traefik.http.routers.oid4vc-waltid.entrypoints: web
traefik.http.routers.oid4vc-waltid.service: oid4vc-waltid
traefik.http.services.oid4vc-waltid.loadbalancer.server.port: "3000"
traefik.http.routers.oid4vc-waltid-grpc.rule: PathPrefix(`/oid4vc-waltid`)
traefik.http.routers.oid4vc-waltid-grpc.middlewares: oid4vc-waltid-grpc-stripprefix
traefik.http.middlewares.oid4vc-waltid-grpc-stripprefix.stripprefix.prefixes: /oid4vc-waltid
traefik.http.routers.oid4vc-waltid-grpc.entrypoints: grpc
traefik.http.routers.oid4vc-waltid-grpc.service: svc_oid4vc-waltid-grpc
traefik.http.services.svc_oid4vc-waltid-grpc.loadbalancer.server.port: "50051"
traefik.http.services.svc_oid4vc-waltid-grpc.loadbalancer.server.scheme: h2c

oid4vc-impierce:
extends:
file: docker-compose.yml
service: oid4vc-impierce
labels:
traefik.enable: true
traefik.http.routers.oid4vc-impierce.rule: Host(`insurance.selv.local`)
traefik.http.routers.oid4vc-impierce.entrypoints: web
traefik.http.routers.oid4vc-impierce.service: oid4vc-impierce
traefik.http.services.oid4vc-impierce.loadbalancer.server.port: "3033"
traefik.http.routers.oid4vc-impierce-grpc.rule: PathPrefix(`/oid4vc-impierce`)
traefik.http.routers.oid4vc-impierce-grpc.middlewares: oid4vc-impierce-grpc-stripprefix
traefik.http.middlewares.oid4vc-impierce-grpc-stripprefix.stripprefix.prefixes: /oid4vc-impierce
traefik.http.routers.oid4vc-impierce-grpc.entrypoints: grpc
traefik.http.routers.oid4vc-impierce-grpc.service: svc_oid4vc-impierce-grpc
traefik.http.services.svc_oid4vc-impierce-grpc.loadbalancer.server.port: "50051"
traefik.http.services.svc_oid4vc-impierce-grpc.loadbalancer.server.scheme: h2c

grpcurl:
image: fullstorydev/grpcurl:latest
volumes:
Expand Down
74 changes: 18 additions & 56 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
version: '3'

services:

##################################################################
# Reverse Proxy and SSL #
##################################################################

traefik:
image: traefik:v2.11
command:
- "--accesslog=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.grpc.address=:5000"
- "--log.level=DEBUG"
ports:
- "${HTTP_PORT}:80/tcp"
- "${GRPC_PORT}:5000/tcp"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./data/letsencrypt:/letsencrypt"

redis:
image: redis:latest
Expand All @@ -42,12 +22,21 @@ services:
environment:
ISSUERS_BANK_DID: did:iota:snd:0x2cfb60f00089a91a96fa8fcee5e2bda15f51b0b062762ad9ca846bba536f8818
ISSUERS_BANK_FRAGMENT: S3zEW4inNy8FYZEMVTEthdzqqSBq1WglM2k75xKHzy0

identity:
image: iotaledger/identity-grpc:alpha
environment:
- API_ENDPOINT=https://api.testnet.shimmer.network
- SNAPSHOT_PATH=/stronghold.hodl
- STRONGHOLD_PWD_FILE=/run/secrets/stronghold_pwd
volumes:
- "./data/stronghold.hodl:/stronghold.hodl"
expose:
- '50051'
labels:
traefik.enable: true
traefik.http.routers.backend.rule: Host(`selv.local`)
traefik.http.routers.backend.entrypoints: web
traefik.http.routers.backend.service: backend
traefik.http.services.backend.loadbalancer.server.port: "3000"
traefik.enable: false
secrets:
- stronghold_pwd

oid4vc-tanglelabs:
build:
Expand All @@ -57,20 +46,14 @@ services:
RP_DID: did:iota:snd:0x2cfb60f00089a91a96fa8fcee5e2bda15f51b0b062762ad9ca846bba536f8818
SIGNER_KEYID: pK0JAYw5RFFKqorBn0x4w98zl2UBfRys
KEY_FRAGMENT: key-1
PUBLIC_URL: "bank.selv.local"
PUBLIC_URL: "bank.selv.iota.org"
expose:
- '3333'
- '50051'
ports:
- "127.0.0.1:3333:3333/tcp"
volumes:
- ./proto:/usr/proto
labels:
traefik.enable: true
traefik.http.routers.oid4vc-tanglelabs.rule: Host(`bank.selv.local`)
traefik.http.routers.oid4vc-tanglelabs.entrypoints: web
traefik.http.routers.oid4vc-tanglelabs.service: oid4vc-tanglelabs
traefik.http.services.oid4vc-tanglelabs.loadbalancer.server.port: "3333"

oid4vc-waltid:
build:
Expand All @@ -83,12 +66,6 @@ services:
- "127.0.0.1:3001:3000/tcp"
volumes:
- ./proto:/usr/proto
labels:
traefik.enable: true
traefik.http.routers.oid4vc-waltid.rule: Host(`government.selv.local`)
traefik.http.routers.oid4vc-waltid.entrypoints: web
traefik.http.routers.oid4vc-waltid.service: oid4vc-waltid
traefik.http.services.oid4vc-waltid.loadbalancer.server.port: "3000"

oid4vc-impierce:
image: impierce/ssi-agent
Expand All @@ -98,12 +75,6 @@ services:
- "127.0.0.1:3033:3033/tcp"
volumes:
- ./proto:/usr/proto
labels:
traefik.enable: true
traefik.http.routers.oid4vc-impierce.rule: Host(`insurance.selv.local`)
traefik.http.routers.oid4vc-impierce.entrypoints: web
traefik.http.routers.oid4vc-impierce.service: oid4vc-impierce
traefik.http.services.oid4vc-impierce.loadbalancer.server.port: "3033"
environment:
#AGENT_CONFIG_LOG_FORMAT: json
AGENT_CONFIG_EVENT_STORE: postgres
Expand All @@ -122,15 +93,6 @@ services:
volumes:
- "./data/db:/docker-entrypoint-initdb.d"

identity:
image: iotaledger/identity-grpc:alpha
environment:
- API_ENDPOINT=http://host.docker.internal
- STRONGHOLD_PWD=nhNc9yAjbCuh6YQxKlceLAUrWCwAYLvu
- SNAPSHOT_PATH=/stronghold.hodl
volumes:
- "./data/stronghold.hodl:/stronghold.hodl"
expose:
- '50051'
labels:
traefik.enable: false
secrets:
stronghold_pwd:
file: data/stronghold_secret.txt
1 change: 1 addition & 0 deletions web/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const CracoAlias = require("craco-alias");
module.exports = {

devServer: {
port: 9000,
devMiddleware: {
writeToDisk: true,
},
Expand Down

0 comments on commit 118a833

Please sign in to comment.