This repository contains a full-stack backend setup using NestJS, MongoDB, and Nginx as a reverse proxy/load balancer. All components are containerized and orchestrated using Docker Compose for a seamless development and deployment experience.
.
βββ mongo/ # MongoDB configuration
βββ src/ # NestJS API source code
βββ nginx/ # Nginx configuration
βββ docker-compose.yml # Docker Compose setup
βββ README.md # Project documentation
- β¨ NestJS - Scalable and modular server-side application framework.
- ποΈ MongoDB - NoSQL database integration for data persistence.
- π Nginx - Reverse proxy/load balancer handling API traffic.
- π³ Docker Compose - Simplified multi-container setup and orchestration.
$ git clone git@github.com:claudiocaldeirao/nest-nginx-mongo.git
$ cd nest-nginx-mongo
$ docker compose up -d
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
# build image
$ docker build -t nest-api:1.0 .
# list images
$ docker images
# run container
$ docker run -p 3000:3000 nest-api:1.0 --d
# list running containers
$ docker container list
# stop running container
$ docker stop <container_id>
# stop all containers at once
$ docker stop $(docker ps -a -q)
# purge images
$ docker image prune --all --force
# delete all images
$ docker rmi -f $(sudo docker images -a -q)
# docker-compose to run multiple containers with nginx as load balancer
$ docker compose up -d
# stop docker-compose containers
$ docker compose down -v
Made by Your Luiz CaldeirΓ£o
This project is licensed under the MIT License.