On my distant server, I use a docker container started with:
MONBULDING_PORT="8080" docker-compose up -d --no-deps --build monbulding-mongo
It works pretty well if I don't set any username/password to authenticate.
Here is the corresponding docker-compose.yaml file:
monbulding-mongo:
image: mongo:latest
ports:
- "27017:27017"
Now, if I want to set a username/password to access to MongoDB, I change this file into:
monbulding-mongo:
image: mongo:latest
ports:
- "27017:27017"
environment:
- AUTH=yes
- MONGODB_ADMIN_USER=admin
- MONGODB_ADMIN_PASS=password
- MONGODB_APPLICATION_DATABASE=app
- MONGODB_APPLICATION_USER=user
- MONGODB_APPLICATION_PASS=password
And if I try to log in to MongoDB using Robo 3T, it doesn't work:
Someone know what I do wrong ? Thanks!
EDIT :
I also tried with mongo shell:
mongo --host domain.net -u admin -p password
But there is an error too.