Skip to content

Commit

Permalink
Merge pull request #668 from credebl/Dockerfile_changes
Browse files Browse the repository at this point in the history
Dockerfile changes
  • Loading branch information
Sheetal-ayanworks authored Apr 17, 2024
2 parents c6636cc + 0ac35e0 commit dec7fcf
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 94 deletions.
26 changes: 3 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 @@ -46,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 @@ -87,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 && 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"]
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.agent-service
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,3 @@ 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"]

# 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
2 changes: 1 addition & 1 deletion Dockerfiles/Dockerfile.api-gateway
Original file line number Diff line number Diff line change
Expand Up @@ -34,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"]
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.connection
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,3 @@ 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/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
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.ecosystem
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,3 @@ 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"]

# docker build -t ecosystem -f Dockerfiles/Dockerfile.ecosystem .
# docker run -d --env-file .env --name ecosystem docker.io/library/ecosystem
# docker logs -f ecosystem
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.issuance
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,3 @@ 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"]

# docker build -t issuance -f Dockerfiles/Dockerfile.issuance .
# docker run -d --env-file .env --name issuance docker.io/library/issuance
# docker logs -f issuance
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.ledger
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ 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"]

# docker build -t ledger -f Dockerfiles/Dockerfile.ledger .
# docker run -d --env-file .env --name ledger docker.io/library/ledger
# docker logs -f ledger
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.notification
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ 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"]

# docker build -t notification -f Dockerfiles/Dockerfile.notification .
# docker run -d --env-file .env --name notification docker.io/library/notification
# docker logs -f notification
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.organization
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,3 @@ 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"]

# docker build -t organization -f Dockerfiles/Dockerfile.organization .
# docker run -d --env-file .env --name issuance docker.io/library/organization
# docker logs -f organization
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.user
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,3 @@ 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"]

# docker build -t user -f Dockerfiles/Dockerfile.user .
# docker run -d --env-file .env --name user docker.io/library/user
# docker logs -f user
30 changes: 1 addition & 29 deletions Dockerfiles/Dockerfile.utility
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
FROM node:18-slim as build
RUN npm install -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] 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/*

# RUN apk update && apk list --all-versions chromium
# Set the working directory
WORKDIR /app

Expand All @@ -35,17 +22,6 @@ RUN pnpm run build utility
# Stage 2: Create the final image
FROM node:18-slim

# 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] 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
Expand All @@ -61,8 +37,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"]

# docker build -t user -f Dockerfiles/Dockerfile.user .
# docker run -d --env-file .env --name user docker.io/library/user
# docker logs -f user
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/utility/main.js"]
6 changes: 1 addition & 5 deletions Dockerfiles/Dockerfile.verification
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,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"]

# docker build -t verification -f Dockerfiles/Dockerfile.verification .
# docker run -d --env-file .env --name verification docker.io/library/verification
# docker logs -f verification
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/verification/main.js"]
4 changes: 0 additions & 4 deletions Dockerfiles/Dockerfile.webhook
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ 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"]

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

0 comments on commit dec7fcf

Please sign in to comment.