Closed iwoork closed 6 years ago
@iwoork the 2 environment variables initialize mongodb, but then you need to provide those also to RESTHeart. At the moment however there isn't an automatic mechanism for reading environment variables, what we usually do is to define a custom restheart configuration file and create our own docker image with that
in your custom restheart.yml edit the mongouri with the same credentials:
mongo-uri: mongodb://<username>:<password>@<host>:<port>/<database>
This way restheart container will connect to the external database. Then you have to build your own Docker image, maybe starting from the official Dockerfile.
Thanks for the response. I managed to make it work by manually logging into the mongo console and setting an admin user and use that credentials on the mongo-uri as stated above.
Might have missed this somewhere but I can't seem to find a way to implement authentication on the mongodb instance. This makes the database accessible to the outside world.
How to implement a username and password on mongodb and also make sure that restheart uses the same configuration?
I tried adding:
but doesn't seem to work