Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/tuantoquq/sample-nestjs-microservices
- Owner: tuantoquq
- Created: 2023-09-27T09:18:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-19T08:43:52.000Z (12 months ago)
- Last Synced: 2024-12-03T22:09:21.823Z (about 2 months ago)
- Topics: docker, microservices, nestjs
- Language: TypeScript
- Homepage:
- Size: 300 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 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 .
```