Skip to content
Snippets Groups Projects
Commit 8287e885 authored by Steffen Schulze's avatar Steffen Schulze
Browse files

Merge branch 'chore/move-docker-compose-to-root' into 'main'

Move docker compose to root

See merge request eclipse/xfsc/ocm/ocm-engine!23
parents ebb39da2 06496cbb
No related branches found
No related tags found
No related merge requests found
...@@ -8,16 +8,6 @@ WORKDIR ${APP_HOME} ...@@ -8,16 +8,6 @@ WORKDIR ${APP_HOME}
RUN corepack enable RUN corepack enable
# # libindy build
# FROM node:20-bullseye AS ssi-base
# RUN apt-get update \
# && apt-get install -y --no-install-recommends libsodium-dev libzmq3-dev
# RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain '1.58.0'
# RUN git clone https://github.com/hyperledger/indy-sdk
# RUN cd indy-sdk/libindy && ~/.cargo/bin/cargo build --release
# RUN cd indy-sdk/libindy && mv target/release/libindy.so /usr/lib/libindy.so
# Build # Build
FROM base AS build FROM base AS build
...@@ -37,15 +27,6 @@ RUN pnpm --filter ${SERVICE} build:production ...@@ -37,15 +27,6 @@ RUN pnpm --filter ${SERVICE} build:production
RUN pnpm --filter ${SERVICE} --prod deploy build RUN pnpm --filter ${SERVICE} --prod deploy build
RUN pnpm --filter shared --prod deploy shared RUN pnpm --filter shared --prod deploy shared
# This is a way of keeping the generated prisma client in the build folder
RUN if [ -d ./apps/${SERVICE}/node_modules/\@prisma/client ]; then \
GLOBAL_PRISMA_SETUP=`realpath ./apps/${SERVICE}/node_modules/\@prisma/client` \
GLOBAL_PRISMA_CLIENT=`readlink -f ${GLOBAL_PRISMA_SETUP}/../../.prisma` \
BUILD_PRISMA_SETUP=`realpath ./build/node_modules/\@prisma/client` \
BUILD_PRISMA_CLIENT=`readlink -f ${BUILD_PRISMA_SETUP}/../..` \
sh -c 'cp -r $GLOBAL_PRISMA_CLIENT $BUILD_PRISMA_CLIENT'; \
fi
# Final # Final
FROM node:20 AS final FROM node:20 AS final
...@@ -69,4 +50,4 @@ RUN node -e "\ ...@@ -69,4 +50,4 @@ RUN node -e "\
fs.writeFileSync('./package.json', JSON.stringify({ name, version, type }, null, 2));\ fs.writeFileSync('./package.json', JSON.stringify({ name, version, type }, null, 2));\
" "
# USER node USER node
# ocm-engine version 1 # Organizational Credential Manager (v2)
#### Dependencies ## Overview
Node 12 OCM (Organizational Credential Manager) is a Node.js-based microservice system designed to manage organizational credentials.
Python 2.5.0 >= <3.0.0
pnpm
### Setup local ## Prerequisites
1. pnpm install * Node.js (version 20 or later)
2. pnpm prisma:generate * pnpm
3. pnpm /app/:build * Docker and Docker Compose for local development
app options: attestation, connection, principal, ssi ## Installation
### Docker compose 1. Clone the repository:
1. Go to compose dir ```bash
git clone https://gitlab.eclipse.org/eclipse/xfsc/ocm/ocm-engine.git
```
2. docker-compose up 2. Navigate to the repository directory:
```bash
cd ocm-engine
```
3. Install dependencies:
```bash
pnpm i
```
4. Start the services locally:
```bash
pnpm -F ssi-abstraction start
pnpm -F connection-manager start
...
```
5. Or start the whole stack in Docker Compose:
```bash
docker compose up -d
```
## Example Flows (OCM Usage) ## Example Flows (OCM Usage)
Please refer to [OCM-flow-overview](documentation/ocm-flow-overview.md) Please refer to [OCM-flow-overview](documentation/ocm-flow-overview.md)
## License
This project is licensed under the [Apache 2.0 License](LICENSE)
...@@ -27,10 +27,10 @@ export class ConnectionsService { ...@@ -27,10 +27,10 @@ export class ConnectionsService {
tenantId: string, tenantId: string,
): Observable<EventDidcommConnectionsGetAll['data']> { ): Observable<EventDidcommConnectionsGetAll['data']> {
return this.natsClient return this.natsClient
.send<EventDidcommConnectionsGetAll, EventDidcommConnectionsGetAllInput>( .send<
EventDidcommConnectionsGetAll.token, EventDidcommConnectionsGetAll,
{ tenantId }, EventDidcommConnectionsGetAllInput
) >(EventDidcommConnectionsGetAll.token, { tenantId })
.pipe(map((result) => result.data)); .pipe(map((result) => result.data));
} }
...@@ -62,10 +62,10 @@ export class ConnectionsService { ...@@ -62,10 +62,10 @@ export class ConnectionsService {
idOrDid: string, idOrDid: string,
): Observable<EventDidcommConnectionsBlock['data']> { ): Observable<EventDidcommConnectionsBlock['data']> {
return this.natsClient return this.natsClient
.send<EventDidcommConnectionsBlock, EventDidcommConnectionsBlockInput>( .send<
EventDidcommConnectionsBlock.token, EventDidcommConnectionsBlock,
{ tenantId, idOrDid }, EventDidcommConnectionsBlockInput
) >(EventDidcommConnectionsBlock.token, { tenantId, idOrDid })
.pipe(map((result) => result.data)); .pipe(map((result) => result.data));
} }
} }
...@@ -25,10 +25,10 @@ export class SchemasService { ...@@ -25,10 +25,10 @@ export class SchemasService {
tenantId: string, tenantId: string,
): Observable<EventAnonCredsSchemasGetAll['data']> { ): Observable<EventAnonCredsSchemasGetAll['data']> {
return this.natsClient return this.natsClient
.send<EventAnonCredsSchemasGetAll, EventAnonCredsSchemasGetAllInput>( .send<
EventAnonCredsSchemasGetAll.token, EventAnonCredsSchemasGetAll,
{ tenantId }, EventAnonCredsSchemasGetAllInput
) >(EventAnonCredsSchemasGetAll.token, { tenantId })
.pipe(map((result) => result.data)); .pipe(map((result) => result.data));
} }
...@@ -37,10 +37,10 @@ export class SchemasService { ...@@ -37,10 +37,10 @@ export class SchemasService {
schemaId: EventAnonCredsSchemasGetByIdInput['schemaId'], schemaId: EventAnonCredsSchemasGetByIdInput['schemaId'],
): Observable<EventAnonCredsSchemasGetById['data']> { ): Observable<EventAnonCredsSchemasGetById['data']> {
return this.natsClient return this.natsClient
.send<EventAnonCredsSchemasGetById, EventAnonCredsSchemasGetByIdInput>( .send<
EventAnonCredsSchemasGetById.token, EventAnonCredsSchemasGetById,
{ tenantId, schemaId }, EventAnonCredsSchemasGetByIdInput
) >(EventAnonCredsSchemasGetById.token, { tenantId, schemaId })
.pipe(map((result) => result.data)); .pipe(map((result) => result.data));
} }
...@@ -49,10 +49,10 @@ export class SchemasService { ...@@ -49,10 +49,10 @@ export class SchemasService {
payload: Omit<EventAnonCredsSchemasRegisterInput, 'tenantId'>, payload: Omit<EventAnonCredsSchemasRegisterInput, 'tenantId'>,
): Observable<EventAnonCredsSchemasRegister['data']> { ): Observable<EventAnonCredsSchemasRegister['data']> {
return this.natsClient return this.natsClient
.send<EventAnonCredsSchemasRegister, EventAnonCredsSchemasRegisterInput>( .send<
EventAnonCredsSchemasRegister.token, EventAnonCredsSchemasRegister,
{ ...payload, tenantId }, EventAnonCredsSchemasRegisterInput
) >(EventAnonCredsSchemasRegister.token, { ...payload, tenantId })
.pipe(map((result) => result.data)); .pipe(map((result) => result.data));
} }
} }
version: '3.9' version: '3.9'
services: services:
connection-manager: nats:
build: image: nats
context: ..
args:
- SERVICE=connection-manager
init: true
ports: ports:
- '3003:3003' - '4222:4222' #Nats server port
depends_on: - '8222:8222' #Nats server Monitoring port
- db
- nats
- ssi
credential-manager: ssi:
build: build:
context: ..
args: args:
- SERVICE=credential-manager - SERVICE=ssi-abstraction
init: true init: true
ports: ports:
- '3011:3011' - '3009:3009'
- '3010:3010'
- '4000:4000'
environment:
NATS_URL: nats://nats:4222
PORT: 3009
AGENT_NAME: ssi-abstraction-agent
AGENT_WALLET_ID: ssi-wallet-id
AGENT_WALLET_KEY: ssi-wallet-key
AGENT_HOST: http://ssi
AGENT_PUBLIC_DID_SEED: 6b8b882e2618fa5d45ee7229ca000000
AGENT_AUTO_ACCEPT_CONNECTION: true
AGENT_AUTO_ACCEPT_CREDENTIAL: contentApproved
AGENT_LEDGER_ID: BCOVRIN_TEST
depends_on: depends_on:
- db
- nats - nats
- ssi
schema-manager: schema-manager:
build: build:
context: ..
args: args:
- SERVICE=schema-manager - SERVICE=schema-manager
init: true init: true
environment:
- HTTP_PORT=3000
- NATS_URL=nats://nats:4222
- NATS_MONITORING_URL=http://nats:8222
- SSI_AGENT_URL=http://ssi:3009
ports: ports:
- '3013:3013' - '4001:3000'
depends_on: depends_on:
- db
- nats - nats
- ssi - ssi
proof-manager: connection-manager:
build: build:
context: ..
args: args:
- SERVICE=proof-manager - SERVICE=connection-manager
init: true init: true
environment:
- HTTP_PORT=3000
- NATS_URL=nats://nats:4222
- NATS_MONITORING_URL=http://nats:8222
- SSI_AGENT_URL=http://ssi:3009
ports: ports:
- '3007:3007' - '4002:3000'
depends_on: depends_on:
- db
- nats - nats
- ssi - ssi
ssi: credential-manager:
build: build:
context: ..
args: args:
- SERVICE=ssi-abstraction - SERVICE=credential-manager
init: true init: true
ports:
- '3009:3009'
- '3010:3010'
- '4000:4000'
environment: environment:
NATS_URL: nats://nats:4222 - HTTP_HOST=0.0.0.0
PORT: 3009 - HTTP_PORT=3000
AGENT_NAME: ssi-abstraction-agent - NATS_URL=nats://nats:4222
AGENT_WALLET_ID: ssi-wallet-id - NATS_MONITORING_URL=http://nats:8222
AGENT_WALLET_KEY: ssi-wallet-key - SSI_AGENT_URL=http://ssi:3009
AGENT_HOST: http://localhost ports:
AGENT_PUBLIC_DID_SEED: 6b8b882e2618fa5d45ee7229ca000000 - '4003:3000'
AGENT_AUTO_ACCEPT_CONNECTION: true
AGENT_AUTO_ACCEPT_CREDENTIAL: contentApproved
AGENT_LEDGER_ID: BCOVRIN_TEST
depends_on: depends_on:
- db
- nats - nats
- ssi
db: # proof-manager:
image: postgres:16 # build:
volumes: # args:
- db-data:/var/lib/postgresql/data # - SERVICE=proof-manager
ports: # init: true
- 5432:5432 # environment:
healthcheck: # - HTTP_HOST=0.0.0.0
test: ['CMD', 'pg_isready', '-q', '-d', 'postgres', '-U', 'root'] # - HTTP_PORT=3000
timeout: 45s # - NATS_URL=nats://nats:4222
interval: 10s # - NATS_MONITORING_URL=http://nats:8222
retries: 10 # - SSI_AGENT_URL=http://ssi:3000
restart: always # ports:
environment: # - '4004:3000'
- POSTGRES_USER=root # depends_on:
- POSTGRES_PASSWORD=password # - nats
# - ssi
nats:
image: nats
ports:
- '4222:4222' #Nats server port
- '8222:8222' #Nats server Monitering port
volumes:
db-data:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment