Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tuantoquq/sample-nestjs-microservices

Sample NestJS Microservice
https://github.com/tuantoquq/sample-nestjs-microservices

docker microservices nestjs

Last synced: 1 day ago
JSON representation

Sample NestJS Microservice

Awesome Lists containing this project

README

        


Nest Logo

## Description

Sample Microservices with NestJS using TCP protocol to communicate between each service.

## Start

### 1. With docker

- Start in development env:

```bash
$ docker compose -f docker-compose.dev.yml up --build
```

- Start in production env:

```bash
$ docker compose -f docker-compose.prod.yml up --build
```

### 2. With Kubernetes

- Firstly, we need create some secrets using for this K8s cluster.

Create secret for MongoDB URI

```bash
$ kubectl create secret generic mongodb --from-literal=connectionString=
```

Create secret for Stripe:

```bash
$ kubectl create secret generic stripe --from-literal=apiKey=
```

Create secret for emails notify:

```bash
$ kubectl create secret generic emails --from-literal=appPassword=
```

- After creating all secrets, we can start microservices with K8s:

```bash
$ cd k8s/mcr-tcp

$ helm install .
```