Skip to content

Commit

Permalink
pipeline implemetation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheetal-ayanworks committed Apr 16, 2024
1 parent ce52590 commit e0f189f
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 117 deletions.
16 changes: 4 additions & 12 deletions Dockerfiles/Dockerfile.api-gateway
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -13,7 +9,7 @@ COPY package.json ./
# COPY package-lock.json ./

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm i

# Copy the rest of the application code
COPY . .
Expand All @@ -25,11 +21,7 @@ RUN pnpm run build api-gateway

# Stage 2: Create the final image
FROM node:18-alpine
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -42,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 && npx prisma generate && cd ../.. && node dist/apps/api-gateway/main.js"]
16 changes: 4 additions & 12 deletions Dockerfiles/Dockerfile.connection
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -13,7 +9,7 @@ COPY package.json ./
#COPY package-lock.json ./

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm i

# Copy the rest of the application code
COPY . .
Expand All @@ -25,11 +21,7 @@ RUN pnpm run build connection

# Stage 2: Create the final image
FROM node:18-alpine
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -49,4 +41,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t connection -f Dockerfiles/Dockerfile.connection .
# docker run -d --env-file .env --name connection docker.io/library/connection
# docker logs -f connection
# docker logs -f connection
16 changes: 4 additions & 12 deletions Dockerfiles/Dockerfile.ecosystem
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -13,7 +9,7 @@ COPY package.json ./
#COPY package-lock.json ./

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm i

# Copy the rest of the application code
COPY . .
Expand All @@ -25,11 +21,7 @@ RUN pnpm run build ecosystem

# Stage 2: Create the final image
FROM node:18-alpine
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -47,4 +39,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t ecosystem -f Dockerfiles/Dockerfile.ecosystem .
# docker run -d --env-file .env --name ecosystem docker.io/library/ecosystem
# docker logs -f ecosystem
# docker logs -f ecosystem
16 changes: 4 additions & 12 deletions Dockerfiles/Dockerfile.issuance
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -13,7 +9,7 @@ COPY package.json ./
#COPY package-lock.json ./

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm i

# Copy the rest of the application code
COPY . .
Expand All @@ -26,11 +22,7 @@ RUN pnpm run build issuance

# Stage 2: Create the final image
FROM node:18-alpine
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -49,4 +41,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t issuance -f Dockerfiles/Dockerfile.issuance .
# docker run -d --env-file .env --name issuance docker.io/library/issuance
# docker logs -f issuance
# docker logs -f issuance
16 changes: 4 additions & 12 deletions Dockerfiles/Dockerfile.ledger
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -13,7 +9,7 @@ COPY package.json ./
#COPY package-lock.json ./

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm i

# Copy the rest of the application code
COPY . .
Expand All @@ -27,11 +23,7 @@ RUN npm run build ledger

# Stage 2: Create the final image
FROM node:18-alpine
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -48,4 +40,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t ledger -f Dockerfiles/Dockerfile.ledger .
# docker run -d --env-file .env --name ledger docker.io/library/ledger
# docker logs -f ledger
# docker logs -f ledger
2 changes: 1 addition & 1 deletion Dockerfiles/Dockerfile.notification
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t notification -f Dockerfiles/Dockerfile.notification .
# docker run -d --env-file .env --name notification docker.io/library/notification
# docker logs -f notification
# docker logs -f notification
16 changes: 4 additions & 12 deletions Dockerfiles/Dockerfile.organization
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

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

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm i

# Copy the rest of the application code
COPY . .
Expand All @@ -26,11 +22,7 @@ RUN pnpm run build organization

# Stage 2: Create the final image
FROM node:18-alpine
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -47,4 +39,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t organization -f Dockerfiles/Dockerfile.organization .
# docker run -d --env-file .env --name issuance docker.io/library/organization
# docker logs -f organization
# docker logs -f organization
4 changes: 2 additions & 2 deletions Dockerfiles/Dockerfile.user
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
RUN rm -rf node_modules

# Install dependencies
RUN pnpm install

Expand Down Expand Up @@ -67,4 +67,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../

# docker build -t user -f Dockerfiles/Dockerfile.user .
# docker run -d --env-file .env --name user docker.io/library/user
# docker logs -f user
# docker logs -f user
28 changes: 10 additions & 18 deletions Dockerfiles/Dockerfile.utility
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Stage 1: Build the application
FROM node:18-slim as build
RUN npm install -g pnpm

RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
# We don't need the standalone Chromium
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

Expand All @@ -26,7 +22,7 @@ WORKDIR /app
COPY package.json ./

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm install

# Copy the rest of the application code
COPY . .
Expand All @@ -38,26 +34,22 @@ RUN pnpm run build utility

# Stage 2: Create the final image
FROM node:18-slim
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot

RUN npm install --ignore-scripts -g pnpm
# We don't need the standalone Chromium
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# RUN apt-get update && apt-get install gnupg wget -y && \
# wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
# sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
# apt-get update && \
# apt-get install google-chrome-stable -y --no-install-recommends && \
# rm -rf /var/lib/apt/lists/*

# 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/utility/ ./dist/apps/utility/
Expand All @@ -73,4 +65,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t user -f Dockerfiles/Dockerfile.user .
# docker run -d --env-file .env --name user docker.io/library/user
# docker logs -f user
# docker logs -f user
16 changes: 4 additions & 12 deletions Dockerfiles/Dockerfile.verification
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Stage 1: Build the application
FROM node:18-alpine as build
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

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

# Install dependencies
RUN pnpm i --ignore-scripts
RUN pnpm i

# Copy the rest of the application code
COPY . .
Expand All @@ -24,11 +20,7 @@ RUN npm run build verification

# Stage 2: Create the final image
FROM node:18-alpine
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

USER nonroot
RUN npm install --ignore-scripts -g pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app

Expand All @@ -45,4 +37,4 @@ CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.

# docker build -t verification -f Dockerfiles/Dockerfile.verification .
# docker run -d --env-file .env --name verification docker.io/library/verification
# docker logs -f verification
# docker logs -f verification
Loading

0 comments on commit e0f189f

Please sign in to comment.