Skip to content
Open
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
82 changes: 0 additions & 82 deletions .github/workflows/ci-cd.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Service Pipeline

on:
workflow_call:
inputs:
image_tag:
required: true
type: string

permissions:
contents: read
id-token: write

env:
AWS_REGION: ap-southeast-2

jobs:

build_and_deploy:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v2

- name: Build image
run: |
docker build \
--build-arg BASE_IMAGE_TAG=${{ inputs.image_tag }} \

- name: Push image
run: |
docker push ${{ secrets.ECR_REGISTRY }}/dispatchai2026-backend:${{ inputs.image_tag }}
docker push ${{ secrets.ECR_REGISTRY }}/dispatchai2026-backend:latest


- name: Deploy
run: |
echo "Trigger deployment (ArgoCD / ECS / Helm)"
25 changes: 0 additions & 25 deletions .github/workflows/trigger.yml

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,31 @@ docker run -p 4000:4000 dispatchai-backend:dev
docker compose up api
```

To run the docker using capet's config
run
'''
docker compose up
'''

To build the image stored in ECR
run

'''
aws ecr get-login-password \
--region ap-southeast-2 \
| docker login \
--username AWS \
--password-stdin 409171460637.dkr.ecr.ap-southeast-2.amazonaws.com
'''

then
'''
docker pull 409171460637.dkr.ecr.ap-southeast-2.amazonaws.com/base-image:latest
'''


remember to set up the correct env.local

## 🔗 Key Integrations

### Twilio Voice API
Expand Down
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3.9"

services:
api:
build:
context: .
dockerfile: Dockerfile
env_file: .env.local
ports:
- "4000:4000"
depends_on:
- redis
restart: unless-stopped

redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"

volumes:
mongo-data:
43 changes: 43 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Stage 1 - Build
ARG BASE_IMAGE_TAG=latest


FROM node:20-alpine AS builder

WORKDIR /app

RUN corepack enable

COPY package.json pnpm-lock.yaml ./
RUN pnpm fetch

COPY . .

RUN pnpm install --offline \
&& pnpm build \
&& pnpm prune --prod





FROM 409171460637.dkr.ecr.ap-southeast-2.amazonaws.com/base-image:${BASE_IMAGE_TAG} AS runtime

WORKDIR /app

COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/templates ./templates

ENV NODE_ENV=production \
PORT=4000
EXPOSE 4000


RUN groupadd -g 1001 appgroup && useradd -u 1001 -g appgroup -m appuser

USER appuser

CMD [ "Node","dist/src/main.js"]

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"dependencies": {
"@aws-sdk/client-ses": "^3.929.0",
"@aws-sdk/client-ses": "^3.974.0",
"@nestjs/axios": "^4.0.0",
"@nestjs/common": "^11.0.11",
"@nestjs/config": "^4.0.1",
"@nestjs/config": "^4.0.3",
"@nestjs/core": "^11.0.11",
"@nestjs/jwt": "^11.0.0",
"@nestjs/mapped-types": "^2.1.0",
"@nestjs/mongoose": "^11.0.1",
"@nestjs/passport": "^11.0.5",
"@nestjs/platform-express": "^11.0.11",
"@nestjs/swagger": "^11.0.6",
"@nestjs/platform-express": "^11.1.16",
"@nestjs/swagger": "^11.2.6",
"@types/cookie-parser": "^1.4.9",
"@types/passport-google-oauth20": "^2.0.16",
"axios": "^1.9.0",
"axios": "^1.13.5",
"bcryptjs": "^3.0.2",
"body-parser": "^2.2.0",
"body-parser": "^2.2.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"class-validator": "^0.14.4",
"cookie-parser": "^1.4.7",
"dotenv": "^16.5.0",
"express": "^5.1.0",
Expand Down
Loading