Welcome to the BE-Services! This repository houses multiple interconnected microservices, each serving a specific functionality. While these microservices do not share code, they do share a common versioning system through a centralized Git repository.
Before getting started, ensure that you have the following prerequisites installed on your system:
- Docker Desktop
- Node.js 18
- Nodemon
If you don't have Nodemon installed globally, you can install it using the following command:
npm install -g nodemon
This command installs Nodemon globally, allowing you to automatically restart Node.js applications when file changes are detected.
To set up and run the microservices, follow the steps below:
-
Clone this repository to your local machine:
git clone <repository_url> cd backend-microservices
-
Obtain the
docker-compose.yml
file from a member of the backend team. -
Run the following command to start the microservices using Docker Compose:
docker-compose up -d
This will launch all the microservices in the background.
-
To run a specific microservice individually, use the following command:
docker-compose up -d <service_name>
Replace
<service_name>
with the name of the desired microservice. You can run multiple microservices simultaneously by separating their names with spaces.
Each microservice should include a deploy.sh
script for easy deployment. The script template is as follows:
#!/bin/bash
REPO_NAME="service-name"
docker build -f ./Dockerfile ./ -t $REPO_NAME:latest
docker-compose up -d --remove-orphans redis
docker-compose up --detach $REPO_NAME
echo "Code updated"
Make sure to customize the REPO_NAME
variable to match the specific service.
Below is a brief overview of the microservices included in this repository:
- Service 1: Description of the first microservice.
- Service 2: Description of the second microservice.
- Service 3: Description of the third microservice.
Feel free to explore each microservice's directory for more detailed information.
If you would like to contribute to this project, please follow our contribution guidelines.
If you encounter any issues or have questions, please open an issue on this repository.
Happy coding!