Skip to content

Commit 928468c

Browse files
authored
fix/update-dockerfile (#1596)
* feat: udpate dockerfile for migration Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com> * feat: udpate dockerfiles for migration Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com> * fix: migration issue in Dockerfile Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com> * fix: migration issue give write access to only prisma folder Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com> * fix: migration issue in Dockerfile remove prisma generate from CMD Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com> * fix: Update seed dockerfile and scripts for AFJ Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com> --------- Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>
1 parent 861d3d6 commit 928468c

25 files changed

Lines changed: 112 additions & 39 deletions

Dockerfiles/Dockerfile.agent-service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ COPY --from=build /app/dist/apps/agent-service/ ./dist/apps/agent-service/
3333
COPY --from=build /app/libs/ ./libs/
3434
COPY --from=build /app/node_modules ./node_modules
3535
USER nextjs
36-
CMD ["node", "dist/apps/agent-service/main.js"]
36+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deployy && cd ../.. && node dist/apps/agent-service/main.js"]

Dockerfiles/Dockerfile.api-gateway

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ COPY --from=build /app/dist/apps/api-gateway/ ./dist/apps/api-gateway/
2323
COPY --from=build /app/libs/ ./libs/
2424
COPY --from=build /app/node_modules ./node_modules
2525
USER nextjs
26-
CMD ["node", "dist/apps/api-gateway/main.js"]
26+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/api-gateway/main.js"]

Dockerfiles/Dockerfile.cloud-wallet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ COPY --from=build /app/dist/apps/cloud-wallet/ ./dist/apps/cloud-wallet/
2323
COPY --from=build /app/libs/ ./libs/
2424
COPY --from=build /app/node_modules ./node_modules
2525
USER nextjs
26-
CMD ["node", "dist/apps/cloud-wallet/main.js"]
26+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/cloud-wallet/main.js"]

Dockerfiles/Dockerfile.connection

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stage 1: Build the application
22
FROM node:24-alpine3.21 AS build
33
RUN apk update && apk upgrade && apk add --no-cache openssl=3.3.6-r0 \
4-
&& rm -rf /var/cache/apk/*
4+
&& rm -rf /var/cache/apk/*
55
RUN npm install -g pnpm@9.15.3 --ignore-scripts
66
WORKDIR /app
77
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
@@ -23,4 +23,4 @@ COPY --from=build /app/dist/apps/connection/ ./dist/apps/connection/
2323
COPY --from=build /app/libs/ ./libs/
2424
COPY --from=build /app/node_modules ./node_modules
2525
USER nextjs
26-
CMD ["node", "dist/apps/connection/main.js"]
26+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/connection/main.js"]

Dockerfiles/Dockerfile.ecosystem

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stage 1: Build the application
22
FROM node:24-alpine3.21 AS build
33
RUN apk update && apk upgrade && apk add --no-cache openssl=3.3.6-r0 \
4-
&& rm -rf /var/cache/apk/*
4+
&& rm -rf /var/cache/apk/*
55
RUN npm install -g pnpm@9.15.3 --ignore-scripts
66
WORKDIR /app
77
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
@@ -23,4 +23,4 @@ COPY --from=build /app/dist/apps/ecosystem/ ./dist/apps/ecosystem/
2323
COPY --from=build /app/libs/ ./libs/
2424
COPY --from=build /app/node_modules ./node_modules
2525
USER nextjs
26-
CMD ["node", "dist/apps/ecosystem/main.js"]
26+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/ecosystem/main.js"]

Dockerfiles/Dockerfile.geolocation

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stage 1: Build the application
22
FROM node:24-alpine3.21 AS build
33
RUN apk update && apk upgrade && apk add --no-cache openssl=3.3.6-r0 \
4-
&& rm -rf /var/cache/apk/*
4+
&& rm -rf /var/cache/apk/*
55
RUN npm install -g pnpm@9.15.3 --ignore-scripts
66
WORKDIR /app
77
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
@@ -23,4 +23,4 @@ COPY --from=build /app/dist/apps/geo-location/ ./dist/apps/geo-location/
2323
COPY --from=build /app/libs/ ./libs/
2424
COPY --from=build /app/node_modules ./node_modules
2525
USER nextjs
26-
CMD ["node", "dist/apps/geo-location/main.js"]
26+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/geo-location/main.js"]

Dockerfiles/Dockerfile.issuance

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stage 1: Build the application
22
FROM node:24-alpine3.21 AS build
33
RUN apk update && apk upgrade && apk add --no-cache openssl=3.3.6-r0 \
4-
&& rm -rf /var/cache/apk/*
4+
&& rm -rf /var/cache/apk/*
55
RUN npm install -g pnpm@9.15.3 --ignore-scripts
66
WORKDIR /app
77
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
@@ -23,4 +23,4 @@ COPY --from=build /app/dist/apps/issuance/ ./dist/apps/issuance/
2323
COPY --from=build /app/libs/ ./libs/
2424
COPY --from=build /app/node_modules ./node_modules
2525
USER nextjs
26-
CMD ["node", "dist/apps/issuance/main.js"]
26+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/issuance/main.js"]

Dockerfiles/Dockerfile.ledger

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stage 1: Build the application
22
FROM node:24-alpine3.21 AS build
33
RUN apk update && apk upgrade && apk add --no-cache openssl=3.3.6-r0 \
4-
&& rm -rf /var/cache/apk/*
4+
&& rm -rf /var/cache/apk/*
55
RUN npm install -g pnpm@9.15.3 --ignore-scripts
66
WORKDIR /app
77
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
@@ -23,4 +23,4 @@ COPY --from=build /app/dist/apps/ledger/ ./dist/apps/ledger/
2323
COPY --from=build /app/libs/ ./libs/
2424
COPY --from=build /app/node_modules ./node_modules
2525
USER nextjs
26-
CMD ["node", "dist/apps/ledger/main.js"]
26+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/ledger/main.js"]

Dockerfiles/Dockerfile.notification

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ COPY --from=build /app/dist/apps/notification/ ./dist/apps/notification/
2222
COPY --from=build /app/libs/ ./libs/
2323
COPY --from=build /app/node_modules ./node_modules
2424
USER nextjs
25-
CMD ["node", "dist/apps/notification/main.js"]
25+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/notification/main.js"]

Dockerfiles/Dockerfile.oid4vc-issuance

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ COPY --from=build /app/dist/apps/oid4vc-issuance/ ./dist/apps/oid4vc-issuance/
2222
COPY --from=build /app/libs/ ./libs/
2323
COPY --from=build /app/node_modules ./node_modules
2424
USER nextjs
25-
CMD ["node", "dist/apps/oid4vc-issuance/main.js"]
25+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/oid4vc-issuance/main.js"]

0 commit comments

Comments
 (0)