Skip to content

Commit

Permalink
Merge pull request #954 from credebl/merge/qa-to-prod-August-2024
Browse files Browse the repository at this point in the history
merge: qa to prod
  • Loading branch information
GHkrishna authored Aug 30, 2024
2 parents 740146f + 2f60ab9 commit 97e419f
Show file tree
Hide file tree
Showing 287 changed files with 187,917 additions and 9,785 deletions.
66 changes: 65 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@ SUPABASE_JWT_SECRET= // Please specify your Supabase jwt secret
API_GATEWAY_PROTOCOL=http
API_GATEWAY_HOST='0.0.0.0'
API_GATEWAY_PORT=5000
API_GATEWAY_PROTOCOL_SECURE=http

##
PLATFORM_NAME= // Please specify your paltform name
PLATFORM_LOGO= // Please specify your paltform logo url
PUBLIC_PLATFORM_SUPPORT_EMAIL= // Please specify your support email
POWERED_BY= // Please specify your powered by org name
PLATFORM_WEB_URL= // Please specify your platform web URL
POWERED_BY_URL= // Please specify your support URL

UPLOAD_LOGO_HOST= // Please specify your logo host or domain url

PUBLIC_LOCALHOST_URL= // Please specify your localhost URL
PUBLIC_DEV_API_URL= // Please specify your DEV environment api URL
PUBLIC_QA_API_URL= // Please specify your your QA environment api URL
PUBLIC_PRODUCTION_API_URL= // Please specify your PRODUCTION environment api URL
PUBLIC_SANDBOX_API_URL= // Please specify your sandbox environment URL

SHORTENED_URL_DOMAIN= // Please specify the domain for your bucket responsible for storing shortened url objects e.g. 'https://bucket-name.s3.ap-east-1.amazonaws.com'
DEEPLINK_DOMAIN= // Please specify your doamin/subdomain responsible for deeplinking with 'url' as a query param e.g. 'https://your-deeplink-domain?url='

AGENT_HOST=[email protected] // Please specify your agent host VM and IP address
AWS_ACCOUNT_ID=xxxxx // Please provide your AWS account Id
Expand All @@ -31,14 +37,46 @@ API_ENDPOINT_PORT=5000

SOCKET_HOST=http://localhost:5000

AWS_PUBLIC_ACCESS_KEY= // Please provide your aws bucket access key
AWS_PUBLIC_SECRET_KEY= // Please provide your aws secret key
AWS_PUBLIC_REGION= // Please provide your aws region
AWS_PUBLIC_BUCKET_NAME= // Please provide your aws bucket name

AWS_ORG_LOGO_BUCKET_NAME= // Please provide your aws org bucket name

AWS_S3_STOREOBJECT_ACCESS_KEY= // Please provide your aws bucket access key
AWS_S3_STOREOBJECT_SECRET_KEY= // Please provide your aws bucket secret key
AWS_S3_STOREOBJECT_REGION= // Please provide your aws region
AWS_S3_STOREOBJECT_BUCKET= // Please provide your aws bucket
AWS_ACCESS_KEY= // Please provide your access key
AWS_SECRET_KEY= // Please provide your secret key
AWS_REGION= // Please provide your aws region
AWS_BUCKET= // Please provide your aws bucket

PLATFORM_ADMIN_EMAIL= // Please provide admin email Id

NATS_HOST='0.0.0.0'
NATS_PORT=4222
NATS_URL=nats://0.0.0.0:4222

REDIS_HOST='0.0.0.0'
REDIS_PORT=6379

POSTGRES_HOST=0.0.0.0
POSTGRES_PORT=5432
POSTGRES_USER='postgres'
POSTGRES_PASSWORD='xxxxx'
POSTGRES_DATABASE= // Please provide your DB name

SENDGRID_API_KEY=xxxxxxxxxxxxxx // Please provide your sendgrid API key

FRONT_END_URL=http://localhost:3000

FILE_SERVER= // Please provide your file server
FILE_SERVER_PORT=8081
FILE_SERVER_USER=credebl
FILE_SERVER_HOST=0.0.0.0

AFJ_AGENT_SPIN_UP=/apps/agent-provisioning/AFJ/scripts/start_agent.sh

WALLET_STORAGE_HOST=localhost # Use IP Address
Expand All @@ -57,12 +95,34 @@ PLATFORM_WALLET_PASSWORD= // Please provide encrypt password using crypto-j
PLATFORM_SEED= // The seed should consist of 32 characters.
PLATFORM_ID=

PLATFORM_PROFILE_MODE= // Please provide your environment name

OOB_BATCH_SIZE=10

AFJ_AGENT_ENDPOINT_PATH=/apps/agent-provisioning/AFJ/endpoints/
DATABASE_URL="postgresql://postgres:xxxxxx@localhost:5432/postgres?schema=public" #Provide supabase postgres URL and Use the correct user/pwd, IP Address
POOL_DATABASE_URL="" #Provide pooler supabase postgres URL
CLUSTER_NAME="" # ecs cluster
TESKDEFINITION_FAMILY="" # ecs task-definition
AGENT_PROTOCOL=http
GEO_LOCATION_MASTER_DATA_IMPORT_SCRIPT=/prisma/scripts/geo_location_data_import.sh
UPDATE_CLIENT_CREDENTIAL_SCRIPT=/prisma/scripts/update_client_credential_data.sh

USER_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for user service
API_GATEWAY_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for api-gateway
ORGANIZATION_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for organization service
AGENT_PROVISIONING_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for agent provisioning service
AGENT_SERVICE_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for agent service
VERIFICATION_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for verification service
ISSUANCE_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for issuance service
CONNECTION_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for connection service
ECOSYSTEM_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for ecosystem service
CREDENTAILDEFINITION_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for credential-definition service
SCHEMA_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for schema service
UTILITIES_NKEY_SEED= xxxxxxxxxxxxx // Please provide Nkeys secret for utilities service
GEOLOCATION_NKEY_SEED= xxxxxxxxxxx // Please provide Nkeys secret for geo-location service

AFJ_AGENT_TOKEN_PATH=/apps/agent-provisioning/AFJ/token/

# This was inserted by prisma init:
# Environment variables declared in this file are automatically made available to Prisma.
Expand All @@ -86,4 +146,8 @@ KEYCLOAK_ADMIN_URL=http://localhost:8080
KEYCLOAK_MASTER_REALM=xxxxxxx
KEYCLOAK_MANAGEMENT_CLIENT_ID=xxxxxxx
KEYCLOAK_MANAGEMENT_CLIENT_SECRET=xxxxxxx
KEYCLOAK_REALM=xxxxxxx
KEYCLOAK_REALM=xxxxxxx

ENABLE_CORS_IP_LIST="" # Provide a list of domains that are allowed to use this server
SCHEMA_FILE_SERVER_URL= // Please provide schema URL
SCHEMA_FILE_SERVER_TOKEN=xxxxxxxx // Please provide schema file server token for polygon
27 changes: 4 additions & 23 deletions Dockerfiles/Dockerfile.agent-provisioning
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Stage 1: Build the application
FROM node:18-alpine as build
# RUN npm install -g pnpm
# Install AWS CLI
# RUN apk update
# RUN apk add openssh-client
# RUN apk update
# RUN apk add aws-cli

RUN set -eux \
&& apk --no-cache add \
openssh-client \
Expand All @@ -16,14 +11,6 @@ RUN set -eux \
&& export PATH=$PATH:/usr/lib/node_modules/pnpm/bin \
&& rm -rf /var/cache/apk/*

RUN docker --version && \
docker-compose --version

ARG ROOT_PATH
ENV ROOT_PATH ${ROOT_PATH}

RUN echo "ROOT_PATH is set to: $ROOT_PATH"

# Set the working directory
WORKDIR /app

Expand All @@ -37,6 +24,7 @@ RUN pnpm i
COPY . .

# Generate Prisma client
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN ls -R /app/apps/agent-provisioning/AFJ/

Expand All @@ -45,11 +33,7 @@ RUN pnpm run build agent-provisioning

# Stage 2: Create the final image
FROM node:18-alpine as prod
# Install AWS CLI
# RUN apk update
# RUN apk add openssh-client
# RUN apk update
# RUN apk add aws-cli

RUN set -eux \
&& apk --no-cache add \
openssh-client \
Expand Down Expand Up @@ -86,7 +70,4 @@ RUN chmod 777 /app/agent-provisioning/AFJ/token
COPY libs/ ./libs/

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/agent-provisioning/main.js $ROOT_PATH"]

# docker build -t agent-provisioning-service -f Dockerfiles/Dockerfile.agent-provisioning .
# docker run -d --env-file .env --name agent-provisioning-service docker.io/library/agent-provisioning-service
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/agent-provisioning/main.js"]
7 changes: 2 additions & 5 deletions Dockerfiles/Dockerfile.agent-service
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN pnpm i

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the user service
Expand Down Expand Up @@ -48,8 +49,4 @@ COPY --from=build /app/libs/ ./libs/
COPY --from=build /app/node_modules ./node_modules

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma migrate deploy && cd ../.. && node dist/apps/agent-service/main.js"]

# docker build -t agent-service -f Dockerfiles/Dockerfile.agent-service .
# docker run -d --env-file .env --name agent-service docker.io/library/agent-service
# docker logs -f agent-service
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/agent-service/main.js"]
3 changes: 2 additions & 1 deletion Dockerfiles/Dockerfile.api-gateway
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN pnpm i

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the api-gateway service
Expand All @@ -33,4 +34,4 @@ COPY --from=build /app/node_modules ./node_modules
# COPY --from=build /app/uploadedFiles ./uploadedFiles

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/api-gateway/main.js"]
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/api-gateway/main.js"]
43 changes: 43 additions & 0 deletions Dockerfiles/Dockerfile.cloud-wallet
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Stage 1: Build the application
FROM node:18-slim as build
RUN npm install -g pnpm

RUN apt-get update -y
RUN apt-get --no-install-recommends install -y openssl
# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./

# Install dependencies
RUN pnpm install

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the user service
RUN pnpm run build cloud-wallet

# Stage 2: Create the final image
FROM node:18-slim

RUN apt-get update -y
RUN apt-get --no-install-recommends install -y openssl
# Set the working directory
WORKDIR /app
RUN npm install -g pnpm

# Copy the compiled code from the build stage
COPY --from=build /app/dist/apps/cloud-wallet/ ./dist/apps/cloud-wallet/

# Copy the libs folder from the build stage
COPY --from=build /app/libs/ ./libs/
#COPY --from=build /app/package.json ./
COPY --from=build /app/node_modules ./node_modules


# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/cloud-wallet/main.js"]
7 changes: 2 additions & 5 deletions Dockerfiles/Dockerfile.connection
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN pnpm i

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the connection service
Expand All @@ -36,8 +37,4 @@ COPY --from=build /app/node_modules ./node_modules
#RUN npm i --only=production

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/connection/main.js"]

# docker build -t connection -f Dockerfiles/Dockerfile.connection .
# docker run -d --env-file .env --name connection docker.io/library/connection
# docker logs -f connection
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/connection/main.js"]
7 changes: 2 additions & 5 deletions Dockerfiles/Dockerfile.ecosystem
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN pnpm i

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the issuance service
Expand All @@ -34,8 +35,4 @@ COPY --from=build /app/node_modules ./node_modules


# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/ecosystem/main.js"]

# docker build -t ecosystem -f Dockerfiles/Dockerfile.ecosystem .
# docker run -d --env-file .env --name ecosystem docker.io/library/ecosystem
# docker logs -f ecosystem
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/ecosystem/main.js"]
40 changes: 40 additions & 0 deletions Dockerfiles/Dockerfile.geolocation
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
#COPY package-lock.json ./

# Install dependencies
RUN pnpm i

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the connection service
RUN pnpm run build geo-location

# Stage 2: Create the final image
FROM node:18-alpine
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

# Copy the compiled code from the build stage
COPY --from=build /app/dist/apps/geo-location/ ./dist/apps/geo-location/

# Copy the libs folder from the build stage
COPY --from=build /app/libs/ ./libs/
#COPY --from=build /app/package.json ./
COPY --from=build /app/node_modules ./node_modules

# Install production dependencies for the final image
#RUN npm i --only=production

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/geo-location/main.js"]
7 changes: 2 additions & 5 deletions Dockerfiles/Dockerfile.issuance
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN pnpm i

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the issuance service
Expand All @@ -35,8 +36,4 @@ COPY --from=build /app/node_modules ./node_modules


# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/issuance/main.js"]

# docker build -t issuance -f Dockerfiles/Dockerfile.issuance .
# docker run -d --env-file .env --name issuance docker.io/library/issuance
# docker logs -f issuance
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/issuance/main.js"]
7 changes: 2 additions & 5 deletions Dockerfiles/Dockerfile.ledger
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN pnpm i

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the ledger service
Expand All @@ -34,8 +35,4 @@ COPY --from=build /app/libs/ ./libs/
COPY --from=build /app/node_modules ./node_modules

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/ledger/main.js"]

# docker build -t ledger -f Dockerfiles/Dockerfile.ledger .
# docker run -d --env-file .env --name ledger docker.io/library/ledger
# docker logs -f ledger
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/ledger/main.js"]
7 changes: 2 additions & 5 deletions Dockerfiles/Dockerfile.notification
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN pnpm i --ignore-scripts

# Copy the rest of the application code
COPY . .
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate

# Build the notification service
Expand All @@ -34,8 +35,4 @@ COPY --from=build /app/libs/ ./libs/
COPY --from=build /app/node_modules ./node_modules

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/notification/main.js"]

# docker build -t notification -f Dockerfiles/Dockerfile.notification .
# docker run -d --env-file .env --name notification docker.io/library/notification
# docker logs -f notification
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/notification/main.js"]
Loading

0 comments on commit 97e419f

Please sign in to comment.