Open Lancer92 opened 1 year ago
I'm afraid I won't be able to assist with that, because I don't have any MS SQL experience at all.
You need to use the container name instead of localhost. With "container_name:" you can also define this permanently.
Example:
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
container_name: db-mssql
ports:
- ${DATABASE_PORT}:1433
volumes:
- ./.data/db:/var/lib/mssql/data
environment:
ACCEPT_EULA: -Y
MSSQL_SA_USER: ${DATABASE_USERNAME}
MSSQL_SA_PASSWORD: ${DATABASE_PASSWORD}
adminer:
image: adminer
restart: always
ports:
- 8080:8080
I use next docker-compose instructions.
However, it works from code (Node.js, TypeORM) but it's shows error when trying to connect from adminer:
SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (localhost) (severity 9)
OS: macOS 12.6 browser: Chrome Version 108.0.5359.98 (Official Build) (x86_64) NodeJS: 18.12.1