I have an instance of mongoDB when I execute docker-compose up -d the mongoDB container is run and he attempt to take the authentification from user.
But I use a docker-compose and I set the credentials inside of this, but when running docker-compose up the user are not connected.
Below, you can see my docker-compose.yml :
version: "2"
services:
web:
image: kolacaine/docker-hello-world
ports:
- "80:8081"
depends_on:
- mongo-service
mongo-service:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: myUserAdmin
MONGO_INITDB_ROOT_PASSWORD: abc123
command: mongod --auth
ports:
- "27017:27017"
And nothing happens, he always ask authentification inside of my container.
mongo-servicewhen I running the shell of mongodb he always ask me to connect, but I set the credentials into my docker-compose