From 640e510a3a3252d54bbb687b85a92a12e68eba75 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Mon, 16 Sep 2024 18:30:31 +0530 Subject: [PATCH 1/4] refactor: add db seed command in docker files Signed-off-by: KulkarniShashank --- Dockerfiles/Dockerfile.agent-provisioning | 13 +++++++++++-- Dockerfiles/Dockerfile.agent-service | 17 ++++++++++++++--- Dockerfiles/Dockerfile.api-gateway | 15 +++++++++++++-- Dockerfiles/Dockerfile.cloud-wallet | 14 ++++++++++++-- Dockerfiles/Dockerfile.connection | 15 +++++++++++++-- Dockerfiles/Dockerfile.ecosystem | 15 +++++++++++++-- Dockerfiles/Dockerfile.geolocation | 15 +++++++++++++-- Dockerfiles/Dockerfile.issuance | 15 +++++++++++++-- Dockerfiles/Dockerfile.ledger | 15 +++++++++++++-- Dockerfiles/Dockerfile.notification | 15 +++++++++++++-- Dockerfiles/Dockerfile.organization | 15 +++++++++++++-- Dockerfiles/Dockerfile.user | 14 ++++++++++++-- Dockerfiles/Dockerfile.utility | 14 ++++++++++++-- Dockerfiles/Dockerfile.verification | 15 +++++++++++++-- Dockerfiles/Dockerfile.webhook | 15 +++++++++++++-- .../prisma/scripts/geo_location_data_import.sh | 2 +- .../scripts/update_client_credential_data.sh | 2 +- 17 files changed, 193 insertions(+), 33 deletions(-) diff --git a/Dockerfiles/Dockerfile.agent-provisioning b/Dockerfiles/Dockerfile.agent-provisioning index 17c820995..dc872a62d 100644 --- a/Dockerfiles/Dockerfile.agent-provisioning +++ b/Dockerfiles/Dockerfile.agent-provisioning @@ -11,6 +11,9 @@ RUN set -eux \ && export PATH=$PATH:/usr/lib/node_modules/pnpm/bin \ && rm -rf /var/cache/apk/* +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -20,12 +23,18 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed RUN ls -R /app/apps/agent-provisioning/AFJ/ # Build the user service @@ -70,4 +79,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 && cd ../.. && node dist/apps/agent-provisioning/main.js"] \ No newline at end of file +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/agent-provisioning/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.agent-service b/Dockerfiles/Dockerfile.agent-service index 0a6d8d3f8..342622a8e 100644 --- a/Dockerfiles/Dockerfile.agent-service +++ b/Dockerfiles/Dockerfile.agent-service @@ -7,8 +7,12 @@ RUN npm install -g pnpm --ignore-scripts \ && apk add aws-cli \ && apk add docker \ && apk add docker-compose - + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + RUN npm install -g pnpm + # Set the working directory WORKDIR /app @@ -18,10 +22,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the user service RUN pnpm run build agent-service @@ -49,4 +60,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 && cd ../.. && node dist/apps/agent-service/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/agent-service/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.api-gateway b/Dockerfiles/Dockerfile.api-gateway index 460cb1751..0400312b5 100644 --- a/Dockerfiles/Dockerfile.api-gateway +++ b/Dockerfiles/Dockerfile.api-gateway @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the api-gateway service RUN pnpm run build api-gateway @@ -34,4 +45,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 && cd ../.. && node dist/apps/api-gateway/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/api-gateway/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.cloud-wallet b/Dockerfiles/Dockerfile.cloud-wallet index 1ddb48e3c..4b3dcab40 100644 --- a/Dockerfiles/Dockerfile.cloud-wallet +++ b/Dockerfiles/Dockerfile.cloud-wallet @@ -2,6 +2,9 @@ FROM node:18-slim as build RUN npm install -g pnpm +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + RUN apt-get update -y RUN apt-get --no-install-recommends install -y openssl # Set the working directory @@ -13,10 +16,17 @@ COPY package.json ./ # Install dependencies RUN pnpm install +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the user service RUN pnpm run build cloud-wallet @@ -40,4 +50,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 && cd ../.. && node dist/apps/cloud-wallet/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/cloud-wallet/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.connection b/Dockerfiles/Dockerfile.connection index bca3dd342..5f8a85544 100644 --- a/Dockerfiles/Dockerfile.connection +++ b/Dockerfiles/Dockerfile.connection @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the connection service RUN pnpm run build connection @@ -37,4 +48,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 && cd ../.. && node dist/apps/connection/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/connection/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.ecosystem b/Dockerfiles/Dockerfile.ecosystem index 892b35d05..cdc8aad0d 100644 --- a/Dockerfiles/Dockerfile.ecosystem +++ b/Dockerfiles/Dockerfile.ecosystem @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the issuance service RUN pnpm run build ecosystem @@ -35,4 +46,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 && cd ../.. && node dist/apps/ecosystem/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/ecosystem/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.geolocation b/Dockerfiles/Dockerfile.geolocation index 3a297b3ce..60648d4f4 100644 --- a/Dockerfiles/Dockerfile.geolocation +++ b/Dockerfiles/Dockerfile.geolocation @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the connection service RUN pnpm run build geo-location @@ -37,4 +48,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 && cd ../.. && node dist/apps/geo-location/main.js"] \ No newline at end of file +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/geo-location/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.issuance b/Dockerfiles/Dockerfile.issuance index cc90ba6f7..d97f7e07b 100644 --- a/Dockerfiles/Dockerfile.issuance +++ b/Dockerfiles/Dockerfile.issuance @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the issuance service RUN pnpm run build issuance @@ -36,4 +47,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 && cd ../.. && node dist/apps/issuance/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/issuance/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.ledger b/Dockerfiles/Dockerfile.ledger index 023a767dc..3231f7015 100644 --- a/Dockerfiles/Dockerfile.ledger +++ b/Dockerfiles/Dockerfile.ledger @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the ledger service RUN npm run build ledger @@ -35,4 +46,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 && cd ../.. && node dist/apps/ledger/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/ledger/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.notification b/Dockerfiles/Dockerfile.notification index ffa746fd0..e66692c11 100644 --- a/Dockerfiles/Dockerfile.notification +++ b/Dockerfiles/Dockerfile.notification @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm --ignore-scripts + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i --ignore-scripts +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the notification service RUN npm run build notification @@ -35,4 +46,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 && cd ../.. && node dist/apps/notification/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/notification/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.organization b/Dockerfiles/Dockerfile.organization index 994c25970..02afb5fcd 100644 --- a/Dockerfiles/Dockerfile.organization +++ b/Dockerfiles/Dockerfile.organization @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -10,10 +14,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the organization service @@ -35,4 +46,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 && cd ../.. && node dist/apps/organization/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/organization/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.user b/Dockerfiles/Dockerfile.user index 68d6e7ada..a532ef9b4 100644 --- a/Dockerfiles/Dockerfile.user +++ b/Dockerfiles/Dockerfile.user @@ -2,6 +2,9 @@ FROM node:18-slim as build RUN npm install -g pnpm +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # We don't need the standalone Chromium ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true ENV PUPPETEER_SKIP_DOWNLOAD true @@ -25,10 +28,17 @@ COPY package.json ./ # Install dependencies RUN pnpm install +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the user service RUN pnpm run build user @@ -63,4 +73,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 && cd ../.. && node dist/apps/user/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/user/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.utility b/Dockerfiles/Dockerfile.utility index f401dae96..d6ab837b2 100644 --- a/Dockerfiles/Dockerfile.utility +++ b/Dockerfiles/Dockerfile.utility @@ -2,6 +2,9 @@ FROM node:18-slim as build RUN npm install -g pnpm +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + RUN apt-get update -y RUN apt-get --no-install-recommends install -y openssl # Set the working directory @@ -13,10 +16,17 @@ COPY package.json ./ # Install dependencies RUN pnpm install +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the user service RUN pnpm run build utility @@ -40,4 +50,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 && cd ../.. && node dist/apps/utility/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/utility/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.verification b/Dockerfiles/Dockerfile.verification index 85524a381..b35120884 100644 --- a/Dockerfiles/Dockerfile.verification +++ b/Dockerfiles/Dockerfile.verification @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -10,10 +14,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the user service RUN npm run build verification @@ -33,4 +44,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 && cd ../.. && node dist/apps/verification/main.js"] \ No newline at end of file +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/verification/main.js"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.webhook b/Dockerfiles/Dockerfile.webhook index b148e1bd6..100a4f996 100644 --- a/Dockerfiles/Dockerfile.webhook +++ b/Dockerfiles/Dockerfile.webhook @@ -1,6 +1,10 @@ # Stage 1: Build the application FROM node:18-alpine as build RUN npm install -g pnpm + +# Add PostgreSQL client to the image +RUN apk add --no-cache postgresql-client + # Set the working directory WORKDIR /app @@ -11,10 +15,17 @@ COPY package.json ./ # Install dependencies RUN pnpm i +RUN pnpm add -D ts-node typescript @types/node + # Copy the rest of the application code COPY . . + +RUN chown -R node:node /app/libs/prisma-service/prisma/scripts/ +RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh + # 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 cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && npx prisma db seed # Build the webhook service RUN pnpm run build webhook @@ -36,4 +47,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 && cd ../.. && node dist/apps/webhook/main.js"] +CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma db seed && cd ../.. && node dist/apps/webhook/main.js"] \ No newline at end of file diff --git a/libs/prisma-service/prisma/scripts/geo_location_data_import.sh b/libs/prisma-service/prisma/scripts/geo_location_data_import.sh index e598ce5f8..61247b088 100755 --- a/libs/prisma-service/prisma/scripts/geo_location_data_import.sh +++ b/libs/prisma-service/prisma/scripts/geo_location_data_import.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Database connection details DB_URL=$1 diff --git a/libs/prisma-service/prisma/scripts/update_client_credential_data.sh b/libs/prisma-service/prisma/scripts/update_client_credential_data.sh index 2b6d49a54..ef104edbe 100755 --- a/libs/prisma-service/prisma/scripts/update_client_credential_data.sh +++ b/libs/prisma-service/prisma/scripts/update_client_credential_data.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Database connection URL DB_URL=$1 From 322fe228b2f873028200d5a8b10626971c1346fc Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Mon, 16 Sep 2024 18:38:03 +0530 Subject: [PATCH 2/4] fix: add igonre scripts Signed-off-by: KulkarniShashank --- Dockerfiles/Dockerfile.agent-provisioning | 2 +- Dockerfiles/Dockerfile.agent-service | 2 +- Dockerfiles/Dockerfile.api-gateway | 2 +- Dockerfiles/Dockerfile.cloud-wallet | 2 +- Dockerfiles/Dockerfile.connection | 2 +- Dockerfiles/Dockerfile.ecosystem | 2 +- Dockerfiles/Dockerfile.geolocation | 2 +- Dockerfiles/Dockerfile.issuance | 2 +- Dockerfiles/Dockerfile.ledger | 2 +- Dockerfiles/Dockerfile.notification | 2 +- Dockerfiles/Dockerfile.organization | 2 +- Dockerfiles/Dockerfile.user | 2 +- Dockerfiles/Dockerfile.utility | 2 +- Dockerfiles/Dockerfile.verification | 2 +- Dockerfiles/Dockerfile.webhook | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfiles/Dockerfile.agent-provisioning b/Dockerfiles/Dockerfile.agent-provisioning index dc872a62d..cf4a2eae8 100644 --- a/Dockerfiles/Dockerfile.agent-provisioning +++ b/Dockerfiles/Dockerfile.agent-provisioning @@ -23,7 +23,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.agent-service b/Dockerfiles/Dockerfile.agent-service index 342622a8e..d1a6e56a0 100644 --- a/Dockerfiles/Dockerfile.agent-service +++ b/Dockerfiles/Dockerfile.agent-service @@ -22,7 +22,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.api-gateway b/Dockerfiles/Dockerfile.api-gateway index 0400312b5..03f98ca19 100644 --- a/Dockerfiles/Dockerfile.api-gateway +++ b/Dockerfiles/Dockerfile.api-gateway @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.cloud-wallet b/Dockerfiles/Dockerfile.cloud-wallet index 4b3dcab40..e9a14e550 100644 --- a/Dockerfiles/Dockerfile.cloud-wallet +++ b/Dockerfiles/Dockerfile.cloud-wallet @@ -16,7 +16,7 @@ COPY package.json ./ # Install dependencies RUN pnpm install -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.connection b/Dockerfiles/Dockerfile.connection index 5f8a85544..347cf68c0 100644 --- a/Dockerfiles/Dockerfile.connection +++ b/Dockerfiles/Dockerfile.connection @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.ecosystem b/Dockerfiles/Dockerfile.ecosystem index cdc8aad0d..866c67de5 100644 --- a/Dockerfiles/Dockerfile.ecosystem +++ b/Dockerfiles/Dockerfile.ecosystem @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.geolocation b/Dockerfiles/Dockerfile.geolocation index 60648d4f4..30bd142aa 100644 --- a/Dockerfiles/Dockerfile.geolocation +++ b/Dockerfiles/Dockerfile.geolocation @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.issuance b/Dockerfiles/Dockerfile.issuance index d97f7e07b..73ce999ba 100644 --- a/Dockerfiles/Dockerfile.issuance +++ b/Dockerfiles/Dockerfile.issuance @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.ledger b/Dockerfiles/Dockerfile.ledger index 3231f7015..4337ff08f 100644 --- a/Dockerfiles/Dockerfile.ledger +++ b/Dockerfiles/Dockerfile.ledger @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.notification b/Dockerfiles/Dockerfile.notification index e66692c11..594d89a1c 100644 --- a/Dockerfiles/Dockerfile.notification +++ b/Dockerfiles/Dockerfile.notification @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.organization b/Dockerfiles/Dockerfile.organization index 02afb5fcd..0efb54dae 100644 --- a/Dockerfiles/Dockerfile.organization +++ b/Dockerfiles/Dockerfile.organization @@ -14,7 +14,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.user b/Dockerfiles/Dockerfile.user index a532ef9b4..b033e899a 100644 --- a/Dockerfiles/Dockerfile.user +++ b/Dockerfiles/Dockerfile.user @@ -28,7 +28,7 @@ COPY package.json ./ # Install dependencies RUN pnpm install -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.utility b/Dockerfiles/Dockerfile.utility index d6ab837b2..f2ee3d34e 100644 --- a/Dockerfiles/Dockerfile.utility +++ b/Dockerfiles/Dockerfile.utility @@ -16,7 +16,7 @@ COPY package.json ./ # Install dependencies RUN pnpm install -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.verification b/Dockerfiles/Dockerfile.verification index b35120884..315d6384d 100644 --- a/Dockerfiles/Dockerfile.verification +++ b/Dockerfiles/Dockerfile.verification @@ -14,7 +14,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.webhook b/Dockerfiles/Dockerfile.webhook index 100a4f996..ee07676f6 100644 --- a/Dockerfiles/Dockerfile.webhook +++ b/Dockerfiles/Dockerfile.webhook @@ -15,7 +15,7 @@ COPY package.json ./ # Install dependencies RUN pnpm i -RUN pnpm add -D ts-node typescript @types/node +RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . From e9848cc6c2bcea2714cb28bb8efdf049a68b4fcf Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Mon, 16 Sep 2024 18:56:52 +0530 Subject: [PATCH 3/4] fix: sonarlint issues Signed-off-by: KulkarniShashank --- Dockerfiles/Dockerfile.agent-provisioning | 9 +++++++-- Dockerfiles/Dockerfile.agent-service | 4 ++-- Dockerfiles/Dockerfile.api-gateway | 4 ++-- Dockerfiles/Dockerfile.cloud-wallet | 4 ++-- Dockerfiles/Dockerfile.connection | 4 ++-- Dockerfiles/Dockerfile.ecosystem | 4 ++-- Dockerfiles/Dockerfile.geolocation | 4 ++-- Dockerfiles/Dockerfile.issuance | 4 ++-- Dockerfiles/Dockerfile.ledger | 4 ++-- Dockerfiles/Dockerfile.notification | 4 ++-- Dockerfiles/Dockerfile.organization | 4 ++-- Dockerfiles/Dockerfile.user | 4 ++-- Dockerfiles/Dockerfile.utility | 4 ++-- Dockerfiles/Dockerfile.verification | 4 ++-- Dockerfiles/Dockerfile.webhook | 4 ++-- 15 files changed, 35 insertions(+), 30 deletions(-) diff --git a/Dockerfiles/Dockerfile.agent-provisioning b/Dockerfiles/Dockerfile.agent-provisioning index cf4a2eae8..6d9ed4c48 100644 --- a/Dockerfiles/Dockerfile.agent-provisioning +++ b/Dockerfiles/Dockerfile.agent-provisioning @@ -2,13 +2,18 @@ FROM node:18-alpine as build RUN set -eux \ + # Install packages and dependencies && apk --no-cache add \ openssh-client \ aws-cli \ docker \ docker-compose \ + postgresql-client \ + # Install pnpm globally without running scripts && npm install -g pnpm --ignore-scripts \ + # Update PATH for pnpm && export PATH=$PATH:/usr/lib/node_modules/pnpm/bin \ + # Clean up && rm -rf /var/cache/apk/* # Add PostgreSQL client to the image @@ -21,9 +26,9 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.agent-service b/Dockerfiles/Dockerfile.agent-service index d1a6e56a0..74fd893e8 100644 --- a/Dockerfiles/Dockerfile.agent-service +++ b/Dockerfiles/Dockerfile.agent-service @@ -20,9 +20,9 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.api-gateway b/Dockerfiles/Dockerfile.api-gateway index 03f98ca19..916889478 100644 --- a/Dockerfiles/Dockerfile.api-gateway +++ b/Dockerfiles/Dockerfile.api-gateway @@ -13,9 +13,9 @@ COPY package.json ./ # COPY package-lock.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.cloud-wallet b/Dockerfiles/Dockerfile.cloud-wallet index e9a14e550..eb7faeb4f 100644 --- a/Dockerfiles/Dockerfile.cloud-wallet +++ b/Dockerfiles/Dockerfile.cloud-wallet @@ -14,9 +14,9 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN pnpm install +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.connection b/Dockerfiles/Dockerfile.connection index 347cf68c0..a18e0fcac 100644 --- a/Dockerfiles/Dockerfile.connection +++ b/Dockerfiles/Dockerfile.connection @@ -13,9 +13,9 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.ecosystem b/Dockerfiles/Dockerfile.ecosystem index 866c67de5..8bd19ae73 100644 --- a/Dockerfiles/Dockerfile.ecosystem +++ b/Dockerfiles/Dockerfile.ecosystem @@ -13,9 +13,9 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.geolocation b/Dockerfiles/Dockerfile.geolocation index 30bd142aa..da9c581f4 100644 --- a/Dockerfiles/Dockerfile.geolocation +++ b/Dockerfiles/Dockerfile.geolocation @@ -13,9 +13,9 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.issuance b/Dockerfiles/Dockerfile.issuance index 73ce999ba..116b31989 100644 --- a/Dockerfiles/Dockerfile.issuance +++ b/Dockerfiles/Dockerfile.issuance @@ -13,9 +13,9 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.ledger b/Dockerfiles/Dockerfile.ledger index 4337ff08f..267c7298e 100644 --- a/Dockerfiles/Dockerfile.ledger +++ b/Dockerfiles/Dockerfile.ledger @@ -13,9 +13,9 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.notification b/Dockerfiles/Dockerfile.notification index 594d89a1c..684289063 100644 --- a/Dockerfiles/Dockerfile.notification +++ b/Dockerfiles/Dockerfile.notification @@ -13,9 +13,9 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i --ignore-scripts +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.organization b/Dockerfiles/Dockerfile.organization index 0efb54dae..b93e55cd2 100644 --- a/Dockerfiles/Dockerfile.organization +++ b/Dockerfiles/Dockerfile.organization @@ -12,9 +12,9 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.user b/Dockerfiles/Dockerfile.user index b033e899a..255c8e619 100644 --- a/Dockerfiles/Dockerfile.user +++ b/Dockerfiles/Dockerfile.user @@ -26,9 +26,9 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN pnpm install +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.utility b/Dockerfiles/Dockerfile.utility index f2ee3d34e..54e021ffb 100644 --- a/Dockerfiles/Dockerfile.utility +++ b/Dockerfiles/Dockerfile.utility @@ -14,9 +14,9 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN pnpm install +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.verification b/Dockerfiles/Dockerfile.verification index 315d6384d..478cb3762 100644 --- a/Dockerfiles/Dockerfile.verification +++ b/Dockerfiles/Dockerfile.verification @@ -12,9 +12,9 @@ WORKDIR /app COPY package.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.webhook b/Dockerfiles/Dockerfile.webhook index ee07676f6..a79ac50af 100644 --- a/Dockerfiles/Dockerfile.webhook +++ b/Dockerfiles/Dockerfile.webhook @@ -13,9 +13,9 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i +RUN pnpm i \ + && pnpm add -D ts-node typescript @types/node --ignore-scripts -RUN pnpm add -D ts-node typescript @types/node --ignore-scripts # Copy the rest of the application code COPY . . From e9dbb5893a0a064118b3ce14cd8fee889b691a67 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Wed, 18 Sep 2024 12:12:52 +0530 Subject: [PATCH 4/4] fix: sonar lint bugs Signed-off-by: KulkarniShashank --- Dockerfiles/Dockerfile.agent-provisioning | 5 ++--- Dockerfiles/Dockerfile.agent-service | 4 ++-- Dockerfiles/Dockerfile.api-gateway | 5 ++--- Dockerfiles/Dockerfile.cloud-wallet | 5 ++--- Dockerfiles/Dockerfile.connection | 5 ++--- Dockerfiles/Dockerfile.ecosystem | 5 ++--- Dockerfiles/Dockerfile.geolocation | 3 ++- Dockerfiles/Dockerfile.issuance | 4 ++-- Dockerfiles/Dockerfile.ledger | 4 ++-- Dockerfiles/Dockerfile.notification | 4 ++-- Dockerfiles/Dockerfile.organization | 4 ++-- Dockerfiles/Dockerfile.user | 4 ++-- Dockerfiles/Dockerfile.utility | 4 ++-- Dockerfiles/Dockerfile.verification | 4 ++-- Dockerfiles/Dockerfile.webhook | 4 ++-- 15 files changed, 30 insertions(+), 34 deletions(-) diff --git a/Dockerfiles/Dockerfile.agent-provisioning b/Dockerfiles/Dockerfile.agent-provisioning index 6d9ed4c48..46a235233 100644 --- a/Dockerfiles/Dockerfile.agent-provisioning +++ b/Dockerfiles/Dockerfile.agent-provisioning @@ -25,11 +25,10 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts - # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.agent-service b/Dockerfiles/Dockerfile.agent-service index 74fd893e8..6f3a1f538 100644 --- a/Dockerfiles/Dockerfile.agent-service +++ b/Dockerfiles/Dockerfile.agent-service @@ -19,8 +19,8 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.api-gateway b/Dockerfiles/Dockerfile.api-gateway index 916889478..12c10e428 100644 --- a/Dockerfiles/Dockerfile.api-gateway +++ b/Dockerfiles/Dockerfile.api-gateway @@ -12,11 +12,10 @@ WORKDIR /app COPY package.json ./ # COPY package-lock.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts - # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.cloud-wallet b/Dockerfiles/Dockerfile.cloud-wallet index eb7faeb4f..4487bf530 100644 --- a/Dockerfiles/Dockerfile.cloud-wallet +++ b/Dockerfiles/Dockerfile.cloud-wallet @@ -13,11 +13,10 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts - # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.connection b/Dockerfiles/Dockerfile.connection index a18e0fcac..6f5f679f5 100644 --- a/Dockerfiles/Dockerfile.connection +++ b/Dockerfiles/Dockerfile.connection @@ -12,11 +12,10 @@ WORKDIR /app COPY package.json ./ #COPY package-lock.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts - # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.ecosystem b/Dockerfiles/Dockerfile.ecosystem index 8bd19ae73..c1ed5209b 100644 --- a/Dockerfiles/Dockerfile.ecosystem +++ b/Dockerfiles/Dockerfile.ecosystem @@ -12,11 +12,10 @@ WORKDIR /app COPY package.json ./ #COPY package-lock.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts - # Copy the rest of the application code COPY . . diff --git a/Dockerfiles/Dockerfile.geolocation b/Dockerfiles/Dockerfile.geolocation index da9c581f4..7108e1e5d 100644 --- a/Dockerfiles/Dockerfile.geolocation +++ b/Dockerfiles/Dockerfile.geolocation @@ -13,7 +13,8 @@ COPY package.json ./ #COPY package-lock.json ./ # Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.issuance b/Dockerfiles/Dockerfile.issuance index 116b31989..d64ed4203 100644 --- a/Dockerfiles/Dockerfile.issuance +++ b/Dockerfiles/Dockerfile.issuance @@ -12,8 +12,8 @@ WORKDIR /app COPY package.json ./ #COPY package-lock.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.ledger b/Dockerfiles/Dockerfile.ledger index 267c7298e..8355392d8 100644 --- a/Dockerfiles/Dockerfile.ledger +++ b/Dockerfiles/Dockerfile.ledger @@ -12,8 +12,8 @@ WORKDIR /app COPY package.json ./ #COPY package-lock.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.notification b/Dockerfiles/Dockerfile.notification index 684289063..06995f650 100644 --- a/Dockerfiles/Dockerfile.notification +++ b/Dockerfiles/Dockerfile.notification @@ -12,8 +12,8 @@ WORKDIR /app COPY package.json ./ #COPY package-lock.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.organization b/Dockerfiles/Dockerfile.organization index b93e55cd2..8c1bec37b 100644 --- a/Dockerfiles/Dockerfile.organization +++ b/Dockerfiles/Dockerfile.organization @@ -11,8 +11,8 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.user b/Dockerfiles/Dockerfile.user index 255c8e619..0ada8ea22 100644 --- a/Dockerfiles/Dockerfile.user +++ b/Dockerfiles/Dockerfile.user @@ -25,8 +25,8 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.utility b/Dockerfiles/Dockerfile.utility index 54e021ffb..d5a223f8a 100644 --- a/Dockerfiles/Dockerfile.utility +++ b/Dockerfiles/Dockerfile.utility @@ -13,8 +13,8 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.verification b/Dockerfiles/Dockerfile.verification index 478cb3762..64571f23a 100644 --- a/Dockerfiles/Dockerfile.verification +++ b/Dockerfiles/Dockerfile.verification @@ -11,8 +11,8 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts diff --git a/Dockerfiles/Dockerfile.webhook b/Dockerfiles/Dockerfile.webhook index a79ac50af..e7054f68e 100644 --- a/Dockerfiles/Dockerfile.webhook +++ b/Dockerfiles/Dockerfile.webhook @@ -12,8 +12,8 @@ WORKDIR /app COPY package.json ./ #COPY package-lock.json ./ -# Install dependencies -RUN pnpm i \ +# Install dependencies safely +RUN pnpm i --ignore-scripts \ && pnpm add -D ts-node typescript @types/node --ignore-scripts