Skip to content

Commit ce58cd2

Browse files
Merge pull request #1210 from credebl/develop
feat/update-docker-compose
2 parents e251d63 + fc78c85 commit ce58cd2

File tree

8 files changed

+286
-49
lines changed

8 files changed

+286
-49
lines changed

.env.demo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ PUBLIC_PRODUCTION_API_URL=https://api.credebl.id
4747
PUBLIC_SANDBOX_API_URL=https://sandboxapi.credebl.id
4848
4949

50-
AFJ_VERSION=credo-0.5.3:latest
50+
AFJ_VERSION=ghcr.io/credebl/credo-controller:latest
5151

5252
PLATFORM_WALLET_NAME=platform-admin
5353
PLATFORM_WALLET_PASSWORD='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
@@ -141,3 +141,8 @@ ELK_PASSWORD=xxxxxx # ELK user password
141141
ORGANIZATION=credebl
142142
CONTEXT=platform
143143
APP=api
144+
145+
#Schema-file-server
146+
APP_PORT=4000
147+
JWT_TOKEN_SECRET=c2e48ca31ac2a0b9af47f3a9f5a0809a858c296948c1326eb746bb7bc945a9d5
148+
ISSUER=Credebl

.github/workflows/continuous-delivery.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
- utility
3030
- verification
3131
- webhook
32+
- organization
33+
- seed
3234

3335
permissions:
3436
contents: read

Dockerfiles/Dockerfile.seed

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:18 as build
2+
3+
# Install pnpm
4+
RUN npm install -g pnpm
5+
6+
# Install PostgreSQL client (use apt for Debian-based images)
7+
RUN apt-get update && apt-get install -y postgresql-client
8+
9+
# Set working directory
10+
WORKDIR /app
11+
12+
COPY . .
13+
14+
RUN pnpm i --ignore-scripts
15+
16+
# Run Prisma commands
17+
RUN cd libs/prisma-service && npx prisma generate
18+
19+
# Set the command to run the microservice
20+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed"]

docker-compose-dev.yml

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
version: '3'
2+
3+
services:
4+
nats:
5+
container_name: nats
6+
entrypoint: '/nats-server -c /nats-server.conf -DV' # Corrected the path to nats-server.conf
7+
image: nats
8+
ports:
9+
- '4222:4222'
10+
- '6222:6222'
11+
- '8222:8222'
12+
# volumes:
13+
# - ./nats-server.conf:/nats-server.conf # Mount the config file
14+
redis:
15+
image: redis:6.2-alpine
16+
restart: always
17+
ports:
18+
- '6379:6379'
19+
command: redis-server --save 20 1 --loglevel warning
20+
volumes:
21+
- cache:/data
22+
api-gateway:
23+
depends_on:
24+
- nats # Use depends_on instead of needs
25+
- redis
26+
build:
27+
context: ./ # Adjust the context path as needed
28+
dockerfile: Dockerfiles/Dockerfile.api-gateway
29+
ports:
30+
- '5000:5000'
31+
env_file:
32+
- ./.env
33+
user:
34+
depends_on:
35+
- nats # Use depends_on instead of needs
36+
- api-gateway
37+
build:
38+
context: ./ # Adjust the context path as needed
39+
dockerfile: Dockerfiles/Dockerfile.user
40+
env_file:
41+
- ./.env
42+
utility:
43+
depends_on:
44+
- nats # Use depends_on instead of needs
45+
- api-gateway
46+
build:
47+
context: ./ # Adjust the context path as needed
48+
dockerfile: Dockerfiles/Dockerfile.utility
49+
env_file:
50+
- ./.env
51+
connection:
52+
depends_on:
53+
- nats # Use depends_on instead of needs
54+
- api-gateway
55+
- utility
56+
- user
57+
build:
58+
context: ./ # Adjust the context path as needed
59+
dockerfile: Dockerfiles/Dockerfile.connection
60+
env_file:
61+
- ./.env
62+
issuance:
63+
depends_on:
64+
- nats # Use depends_on instead of needs
65+
- redis
66+
- api-gateway
67+
- user
68+
- connection
69+
build:
70+
context: ./ # Adjust the context path as needed
71+
dockerfile: Dockerfiles/Dockerfile.issuance
72+
env_file:
73+
- ./.env
74+
ledger:
75+
depends_on:
76+
- nats # Use depends_on instead of needs
77+
- api-gateway
78+
- user
79+
- connection
80+
- issuance
81+
build:
82+
context: ./ # Adjust the context path as needed
83+
dockerfile: Dockerfiles/Dockerfile.ledger
84+
env_file:
85+
- ./.env
86+
organization:
87+
depends_on:
88+
- nats # Use depends_on instead of needs
89+
- api-gateway
90+
- user
91+
- connection
92+
- issuance
93+
- ledger
94+
build:
95+
context: ./ # Adjust the context path as needed
96+
dockerfile: Dockerfiles/Dockerfile.organization
97+
env_file:
98+
- ./.env
99+
verification:
100+
depends_on:
101+
- nats # Use depends_on instead of needs
102+
- api-gateway
103+
- user
104+
- connection
105+
- issuance
106+
- ledger
107+
- organization
108+
build:
109+
context: ./ # Adjust the context path as needed
110+
dockerfile: Dockerfiles/Dockerfile.verification
111+
env_file:
112+
- ./.env
113+
agent-provisioning:
114+
depends_on:
115+
- nats # Use depends_on instead of needs
116+
- api-gateway
117+
- user
118+
- connection
119+
- issuance
120+
- ledger
121+
- organization
122+
- verification
123+
build:
124+
context: ./ # Adjust the context path as needed
125+
dockerfile: Dockerfiles/Dockerfile.agent-provisioning
126+
args:
127+
- ROOT_PATH=$PWD/apps/agent-provisioning/AFJ/agent-config
128+
env_file:
129+
- ./.env
130+
environment:
131+
- ROOT_PATH=$PWD/apps/agent-provisioning/AFJ/agent-config
132+
volumes:
133+
- $PWD/apps/agent-provisioning/AFJ/agent-config:/app/agent-provisioning/AFJ/agent-config
134+
- /var/run/docker.sock:/var/run/docker.sock
135+
- /app/agent-provisioning/AFJ/token:/app/agent-provisioning/AFJ/token
136+
- $PWD/agent.env:/app/agent.env
137+
agent-service:
138+
depends_on:
139+
- nats # Use depends_on instead of needs
140+
- api-gateway
141+
- user
142+
- connection
143+
- issuance
144+
- ledger
145+
- organization
146+
- verification
147+
- agent-provisioning
148+
command: sh -c 'until (docker logs platform-agent-provisioning-1 | grep "Agent-Provisioning-Service Microservice is listening to NATS"); do sleep 1; done && node dist/apps/agent-service/main.js'
149+
build:
150+
context: ./ # Adjust the context path as needed
151+
dockerfile: Dockerfiles/Dockerfile.agent-service
152+
env_file:
153+
- ./.env
154+
volumes:
155+
- /var/run/docker.sock:/var/run/docker.sock
156+
volumes_from:
157+
- agent-provisioning
158+
cloud-wallet:
159+
depends_on:
160+
- nats
161+
- api-gateway
162+
build:
163+
context: ./ # Adjust the context path as needed
164+
dockerfile: Dockerfiles/Dockerfile.cloud-wallet
165+
env_file:
166+
- ./.env
167+
geolocation:
168+
depends_on:
169+
- nats
170+
- api-gateway
171+
build:
172+
context: ./ # Adjust the context path as needed
173+
dockerfile: Dockerfiles/Dockerfile.geolocation
174+
env_file:
175+
- ./.env
176+
notification:
177+
depends_on:
178+
- nats
179+
- api-gateway
180+
build:
181+
context: ./ # Adjust the context path as needed
182+
dockerfile: Dockerfiles/Dockerfile.notification
183+
env_file:
184+
- ./.env
185+
webhook:
186+
depends_on:
187+
- nats
188+
- api-gateway
189+
build:
190+
context: ./ # Adjust the context path as needed
191+
dockerfile: Dockerfiles/Dockerfile.webhook
192+
env_file:
193+
- ./.env
194+
195+
196+
197+
198+
volumes:
199+
cache:
200+
driver: local

docker-compose.nats.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
services:
3+
nats:
4+
container_name: nats # Sets the name of the container to nats
5+
image: nats # Uses the official NATS Docker image
6+
command: ["-c", "/nats-server.conf"] # Passes the NATS configuration file to the container at startup
7+
ports:
8+
- '4222:4222' # Main NATS client communication port
9+
- '6222:6222' # Routing port for NATS clusters
10+
- '8222:8222' # HTTP monitoring port for server statistics and health checks
11+
volumes:
12+
- ./nats-server.conf:/nats-server.conf:ro # Mounts the nats-server.conf configuration file into the container as read-only (ro)

docker-compose.redis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
services:
3+
redis:
4+
image: redis:6.2-alpine
5+
restart: always
6+
ports:
7+
- '6379:6379'
8+
command: redis-server --save 20 1 --loglevel warning
9+
volumes:
10+
- cache:/data
11+
volumes:
12+
cache:

0 commit comments

Comments
 (0)