Build and Deploy Steps

A. Running Locally without Docker

Clone repository

# Fork and Clone the Repository
git clone https://github.com/PSMRI/ubi-beneficiary-backend.git
cd ubi-beneficiary-backend

# Check out the main branch
git checkout main

Install Dependencies

# Install dependencies
npm install

Optional - Set up Git hooks

# Set up Git hooks (Husky)
npm run prepare
git config core.hooksPath .husky/_
chmod +x .husky/pre-commit
chmod +x .husky/commit-msg

Create / Update .env

Ensure you have created and updated .env with required variables

Running in Dev Mode

The backend will be available at: 👉 http://localhost:3000arrow-up-right

Running in Production Mode

B. Running with Docker

Create / Update .env

Ensure you have created and updated .env with required variables

Build Docker Image Run Steps

Using Dockerfilearrow-up-right from the repo code, you can generate an image

Example .env for docker

The docker-compose.yml requires a separate file .env

Use Image in docker-compose

Use generated images in docker-compose.ymlarrow-up-right

More about docker-compose

The docker-compose.ymlarrow-up-right located in the root of the repository provisions the following services:

  • Postgres (port 5432)

  • pgAdmin (port 8082)

  • Keycloak (port 8080)

  • Hasura GraphQL Engine (port 8081)

Verify Services

Last updated