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 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: 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"] + + 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