aspnetrun / run-aspnetcore-microservices

Microservices on .Net platforms which used ASP.NET Web API, Docker, RabbitMQ, MassTransit, Grpc, Yarp API Gateway, PostgreSQL, Redis, SQLite, SqlServer, Marten, Entity Framework Core, CQRS, MediatR, DDD, Vertical and Clean Architecture implementation with using latest features of .NET 8 and C# 12
https://www.udemy.com/course/microservices-architecture-and-implementation-on-dotnet/?couponCode=JUNE24
MIT License
2.53k stars 1.38k forks source link

SQl server Database is not connected using docker compose #81

Open viralchauhan opened 4 months ago

viralchauhan commented 4 months ago

I am trying last 3 days sql server database connectivity not work

compose file below

orderdb: container_name: orderdb environment: SA_PASSWORD: "SwN12345678" ACCEPT_EULA: "Y" restart: always ports:

I have not use entity framework I am using dapper

I have check API connection string is "Server=orderdb;Database=OrderDb;User Id=sa;Password=SwN12345678"

error given is docker-compose database container file Login failed for user 'sa'. Reason: Failed to open the explicitly specified database 'OrderDb'. [CLIENT: 172.20.0.3]

How to fix this issues

I have try to remove orderdb and try this host.docker.internal,1433 working fine so how to multicontainer setup

arminatwork commented 4 months ago

@viralchauhan I think you need to create a network bridge. see my last issue about Ocelot's and docker-compose configurations. you will figure it out