Skip to content

Commit 86fbb99

Browse files
authored
Merge pull request #9 from samagra-comms/main
Bring dev up to par with main
2 parents be18802 + 0b1d8c2 commit 86fbb99

File tree

5 files changed

+106
-6
lines changed

5 files changed

+106
-6
lines changed

.env.sample

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
APP_PORT=80
2+
3+
#Supabase: Database
4+
SUPABASE_URL=''
5+
## This is Service Key, disables RLS
6+
SUPABASE_KEY=''
7+
## Adapter Config
8+
BASE_URL=''
9+
ADAPTER_ADMIN_TOKEN=""
10+
VAULT_SERVICE_URL=''
11+
VAULT_SERVICE_TOKEN=''
12+
GUPSHUP_API_ENDPOINT=''
13+
14+
## Orchestrator
15+
ORCHESTRATOR_API_ENDPOINT=''
16+
ORCHESTRATOR_FEEDBACK_ENDPOINT=''

.github/workflows/build-and-push.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- prod
8+
9+
env:
10+
DOCKER_USERNAME: ${{ github.actor }}
11+
DOCKER_IMAGE_NAME: ${{ github.repository }}
12+
DOCKER_REGISTRY: ghcr.io
13+
DOCKER_IMAGE_TAG: ${{ github.ref_name }}
14+
15+
jobs:
16+
build-and-push:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- id: lower-repo
20+
shell: pwsh
21+
run: |
22+
"::set-output name=repository::$($env:DOCKER_IMAGE_NAME.ToLowerInvariant())"
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v2
29+
30+
- name: Login to Docker registry
31+
uses: docker/login-action@v1
32+
with:
33+
registry: ${{ env.DOCKER_REGISTRY }}
34+
username: ${{ env.DOCKER_USERNAME }}
35+
password: ${{ secrets.PAT }}
36+
37+
- name: Build and Push Docker image
38+
uses: docker/build-push-action@v4
39+
with:
40+
build-args: |
41+
"SERVER_RELEASE_VERSION=${{ github.sha }}"
42+
context: .
43+
push: true
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max
46+
tags: ${{ env.DOCKER_REGISTRY }}/${{ steps.lower-repo.outputs.repository }}:${{env.DOCKER_IMAGE_TAG}}
47+
labels: org.opencontainers.image.source=https://github.com/${{steps.lower-repo.outputs.repository}}

.github/workflows/docker-image.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "prod" ]
6+
pull_request:
7+
branches: [ "dev" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Build the Docker image
18+
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)

Dockerfile

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
1-
FROM node:21-bullseye
2-
3-
RUN apt-get -q update
1+
# Stage 1: Build the application
2+
FROM node:18-bullseye AS builder
43

54
WORKDIR /app
65

7-
COPY . .
6+
# Copy package.json and yarn.lock files
7+
COPY package.json yarn.lock ./
88

9+
# Install dependencies
910
RUN yarn install
1011

12+
# Copy the rest of the application source code
13+
COPY . .
14+
15+
# Build the application
1116
RUN yarn build
1217

13-
ENTRYPOINT [ "yarn", "start:prod" ]
18+
# Stage 2: Create the run-time image
19+
FROM node:18-bullseye
20+
21+
WORKDIR /app
22+
23+
# Copy the built application from the previous stage
24+
COPY --from=builder /app/node_modules ./node_modules
25+
COPY --from=builder /app/dist ./dist
26+
COPY --from=builder /app/package.json ./
27+
COPY --from=builder /app/yarn.lock ./
28+
29+
ARG SERVER_RELEASE_VERSION
30+
ENV SERVER_RELEASE_VERSION=${SERVER_RELEASE_VERSION}
31+
32+
# Set the entrypoint to start the application
33+
ENTRYPOINT [ "yarn", "start:prod" ]

src/message/message.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Module } from '@nestjs/common';
22
import { MessageController } from './controllers/inbound.message.controller';
33
import { InboundService } from './services/inbound/inbound.service';
4-
// import { SupabaseService } from './services/supabase.service';
54
import { ConfigModule } from '@nestjs/config';
65
import { OutboundService } from './services/outbound/outbound.service';
76

0 commit comments

Comments
 (0)