Skip to content

Instantly share code, notes, and snippets.

@svikas641
Created January 9, 2024 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svikas641/a57176b5f473464787bb2f0042b79ed1 to your computer and use it in GitHub Desktop.
Save svikas641/a57176b5f473464787bb2f0042b79ed1 to your computer and use it in GitHub Desktop.

BE-Services

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.

Prerequisites

Before getting started, ensure that you have the following prerequisites installed on your system:

Installing 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.

Getting Started

To set up and run the microservices, follow the steps below:

  1. Clone this repository to your local machine:

    git clone <repository_url>
    cd backend-microservices
  2. Obtain the docker-compose.yml file from a member of the backend team.

  3. Run the following command to start the microservices using Docker Compose:

    docker-compose up -d

    This will launch all the microservices in the background.

  4. 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.

Deploy Script

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.

Microservices Overview

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.

Contributing

If you would like to contribute to this project, please follow our contribution guidelines.

Issues and Support

If you encounter any issues or have questions, please open an issue on this repository.

Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment