Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQl server Database is not connected using docker compose #81

Open
viralchauhan opened this issue Feb 9, 2024 · 1 comment
Open

SQl server Database is not connected using docker compose #81

viralchauhan opened this issue Feb 9, 2024 · 1 comment

Comments

@viralchauhan
Copy link

viralchauhan commented Feb 9, 2024

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:
- "1433:1433"

ordering.api:
container_name: ordering.api
environment:
- ASPNETCORE_ENVIRONMENT=Development
- "ConnectionStrings:OrderingConnectionString=Server=orderdb;Database=OrderDb;User Id=sa;Password=SwN12345678"
- "EventBusSettings:HostAddress=amqp://guest:guest@rabbitmq:5672"
- "ElasticConfiguration:Uri=http://elasticsearch:9200"
depends_on:
- orderdb
- rabbitmq
ports:
- "8004:80"

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

@armintodev
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants