From 0f5235f23a7d42abd36e0cdfeac81e883ecf0950 Mon Sep 17 00:00:00 2001 From: Akash Shaw Date: Thu, 28 Mar 2024 21:01:32 +0530 Subject: [PATCH 1/4] chore: adding mail-zeus image build and push --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2166f9da..46c847d2 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -119,6 +119,24 @@ jobs: - name: Push @paybox/chat-zeus Docker image run: docker push shawakash/paybox-chat-zeus:${{ github.sha }} + mail_zeus_image: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build @paybox/mail-zeus Docker image + run: docker build -t shawakash/paybox-mail-zeus:${{ github.sha }} -f ./docker/mail-zeus/Dockerfile . + + - name: Push @paybox/mail-zeus Docker image + run: docker push shawakash/paybox-mail-zeus:${{ github.sha }} + backend_common_image: runs-on: ubuntu-latest steps: From 332a5424c859471a0cd322d1c847e4e8cd33c86b Mon Sep 17 00:00:00 2001 From: Akash Shaw Date: Thu, 28 Mar 2024 21:02:00 +0530 Subject: [PATCH 2/4] chore: workflow for mail server --- .github/workflows/backend-mail.yml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/backend-mail.yml diff --git a/.github/workflows/backend-mail.yml b/.github/workflows/backend-mail.yml new file mode 100644 index 00000000..6edab20d --- /dev/null +++ b/.github/workflows/backend-mail.yml @@ -0,0 +1,36 @@ +name: Deploy backend-mail + +on: + push: + branches: + - dev + pull_request: + branches: + - dev +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: "mv docker/mail/Dockerfile ." + + - name: add secrets + env: + DOCKER_USER: ${{secrets.DOCKERHUB_USERNAME}} + DOCKER_PASSWORD: ${{secrets.DOCKERHUB_TOKEN}} + run: | + cd backend/api + touch .env + cd ../.. + + - name: docker login + env: + DOCKER_USER: ${{secrets.DOCKERHUB_USERNAME}} + DOCKER_PASSWORD: ${{secrets.DOCKERHUB_TOKEN}} + run: | + docker login -u $DOCKER_USER -p $DOCKER_PASSWORD + - name: Build the Docker image + run: docker build . --tag shawakash/paybox-mail:${{ github.sha }} + + - name: Docker Push + run: docker push shawakash/paybox-mail:${{ github.sha }} \ No newline at end of file From 2c4863b1080829c915bbba033e12c8aa7620edb2 Mon Sep 17 00:00:00 2001 From: Akash Shaw Date: Thu, 28 Mar 2024 21:02:17 +0530 Subject: [PATCH 3/4] chore: dockerfile for mail-zeus --- docker/mail-zeus/Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docker/mail-zeus/Dockerfile diff --git a/docker/mail-zeus/Dockerfile b/docker/mail-zeus/Dockerfile new file mode 100644 index 00000000..de9d5112 --- /dev/null +++ b/docker/mail-zeus/Dockerfile @@ -0,0 +1,28 @@ +# Use the official Node.js image as the base image +FROM node:21 + +WORKDIR /base + +COPY ["package.json", "./package.json"] +COPY [".yarnrc", "./.yarnrc"] +COPY [".npmrc", "./.npmrc"] +COPY [".eslintrc.js", "./.eslintrc.js"] +COPY ["turbo.json", "./turbo.json"] +COPY ["yarn.lock", "./yarn.lock"] +COPY ["tsconfig.json", "./tsconfig.json"] + +COPY ["packages/typescript-config", "./packages/typescript-config"] +COPY ["packages/eslint-config", "./packages/teslint-config"] +COPY ["backend/mail-zeus", "./backend/mail-zeus"] + +RUN cd /base +RUN yarn install +RUN yarn run build + +WORKDIR /base/backend/mail-zeus + +CMD ["yarn", "zeus"] +CMD ["yarn", "codegen"] +CMD ["yarn", "dev"] + + From 6d1e4a204bdaabce6d957f5e32613755516f1827 Mon Sep 17 00:00:00 2001 From: Akash Shaw Date: Thu, 28 Mar 2024 21:02:28 +0530 Subject: [PATCH 4/4] chore: dockerfile for mail server --- docker/mail/Dockerfile | 28 ++++++++++++++++++++++++++++ docker/mail/buildspec.yml | 19 +++++++++++++++++++ docker/mail/docker-compose.yml | 9 +++++++++ 3 files changed, 56 insertions(+) create mode 100644 docker/mail/Dockerfile create mode 100644 docker/mail/buildspec.yml create mode 100644 docker/mail/docker-compose.yml diff --git a/docker/mail/Dockerfile b/docker/mail/Dockerfile new file mode 100644 index 00000000..17ca6411 --- /dev/null +++ b/docker/mail/Dockerfile @@ -0,0 +1,28 @@ +FROM node:21 + +WORKDIR /base + +COPY ["package.json", "./package.json"] +COPY [".yarnrc", "./.yarnrc"] +COPY [".npmrc", "./.npmrc"] +COPY [".eslintrc.js", "./.eslintrc.js"] +COPY ["turbo.json", "./turbo.json"] +COPY ["yarn.lock", "./yarn.lock"] +COPY ["tsconfig.json", "./tsconfig.json"] + +COPY ["packages/typescript-config", "./packages/typescript-config"] +COPY ["packages/eslint-config", "./packages/eslint-config"] +COPY ["packages/common", "./packages/common"] +COPY ["backend/mail-zeus", "./backend/mail-zeus"] +COPY ["backend/mail", "./backend/mail"] + + +RUN cd /base +RUN yarn install +RUN yarn run build + +EXPOSE 25 + +WORKDIR /base/backend/mail + +CMD ["yarn", "dev"] diff --git a/docker/mail/buildspec.yml b/docker/mail/buildspec.yml new file mode 100644 index 00000000..34073804 --- /dev/null +++ b/docker/mail/buildspec.yml @@ -0,0 +1,19 @@ +version: 0.2 + +env: + secrets-manager: + + +phases: + install: + runtime-versions: + nodejs: 21 + build: + commands: + - mv docker/mail/Dockerfile . + - cd backend/mail + - touch .env + - cd ../.. +artifacts: + files: + - '**/*' \ No newline at end of file diff --git a/docker/mail/docker-compose.yml b/docker/mail/docker-compose.yml new file mode 100644 index 00000000..94a49a33 --- /dev/null +++ b/docker/mail/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.8" + +services: + backendapi: + image: shawakash/paybox-mail:{{tag}} + restart: unless-stopped + ports: + - 25:25 + command: "yarn dev" \ No newline at end of file