Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: docker for mail and mail-zeus #326

Merged
merged 5 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/backend-mail.yml
Original file line number Diff line number Diff line change
@@ -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 }}
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 28 additions & 0 deletions docker/mail-zeus/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]


28 changes: 28 additions & 0 deletions docker/mail/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
19 changes: 19 additions & 0 deletions docker/mail/buildspec.yml
Original file line number Diff line number Diff line change
@@ -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:
- '**/*'
9 changes: 9 additions & 0 deletions docker/mail/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.8"

services:
backendapi:
image: shawakash/paybox-mail:{{tag}}
restart: unless-stopped
ports:
- 25:25
command: "yarn dev"
Loading