This is repository a demonstration of a microservices architecture using .NET Core, RabbitMQ, Docker, and Docker Compose. This project showcases a modular approach to building scalable and maintainable applications.
The solution is structured into multiple services, each encapsulating specific business logic and responsibilities:
- Core: The foundational layer containing shared logic and utilities.
- FileService: Handles file-related operations.
- RenderingService: Manages rendering tasks.
- TemplateService: Responsible for template management.
- UserService: Manages user-related functionalities.
Each service is designed to be independently deployable, promoting a decoupled and scalable system.(Medium)
The repository includes several Docker-related configurations:
- Dockerfiles: Each service has its own
Dockerfilefor containerization. - docker-compose.yml: Defines the multi-container Docker application.
- docker-compose.development.yml: Specifically tailored for the development environment.
- docker-compose.production.yml: Optimized for the production environment.
These configurations facilitate the orchestration of services, ensuring consistent environments across development and production stages.
RabbitMQ is utilized for asynchronous communication between services. This message broker enables:(Medium)
- Decoupling: Services can communicate without direct dependencies.
- Scalability: Easily handle increased loads by scaling services independently.
- Reliability: Ensures messages are delivered even if a service is temporarily unavailable.(GitHub)
Implementing RabbitMQ in this architecture allows for efficient and reliable inter-service communication.(DevOps.dev)
To set up the project locally:
-
Clone the repository:
git clone https://github.com/aekoky/dotnet-microservices.git cd dotnet-microservices -
Build and start the services:
docker-compose -f docker-compose.yml up --build
This command will build the images and start the containers as defined in the docker-compose.yml file.
-
Access the services:
Once the containers are running, you can access the services via their respective ports as specified in the
docker-composeconfigurations.
For a more in-depth understanding and additional configurations, refer to the repository's README.md.
- Getting Started with .NET Core, Docker, and RabbitMQ — Part 3: A tutorial that walks through integrating RabbitMQ with .NET Core and Docker.
- Docker-Compose for Asp.Net Core & RabbitMQ: An article demonstrating how to configure a Docker-Compose environment for ASP.NET Core Web API and RabbitMQ.(DevOps.dev, DevOps.dev)
These resources provide further insights into building and managing microservices architectures with the mentioned technologies.
If you have any specific questions or need assistance with any part of the setup, feel free to ask!