Thonk
Docker and .NET migrations
Hello everyone,
I created a Dockerfile for each of my APIs (using .NET 9) and a Docker Compose file to containerize all my applications. I've done some research, but I have a few questions:
In a microservices architecture, should each service have its own database?
(e.g., Auth.API => PostgreSQL and Story.API => MongoDB)
Also, I can't apply the EF migrations once my Auth service is running in its container. I checked this link: https://www.reddit.com/r/csharp/comments/1h3kt2r/aspnet_8_and_docker/
I understand the theory of adding a separate Dockerfile just to apply the migration once the API and the database are up and running in the container, but I can't figure out how to implement it. Do you have any advice or ideas?
Thanks in advance for your help!
6 replies
Looking for a mentor
Hello everyone!
I'm an ASP.NET Core developer with 2 years of experience, currently working on a mini social network project.
Right now, I'm focusing solely on the back end. My goal is to build separate APIs and databases for each feature (e.g., Publication.API, User.API, Auth.API) and connect them through an API Gateway.
I'm looking for someone more experienced who has some time to guide me, answer questions, and help me grow as a developer—a mentor, essentially.
If you're interested and available, I’d really appreciate your help!
4 replies