For the sake of consistency across all the envs our apps ends up running (Platform.sh, local Lando, etc.) I’d like to configure MongoDB on CircleCI so that authorisation is enabled. I have not been able to figure out how to do that so far. Any suggestions?
Would you show us what you have so far? I imagine how to do so in the Mongo docs.
Assuming you are running Mongo as a secondary Docker container, you can pass all sorts of custom commands and env vars in Circle in the YAML format - see the docker key configuration reference in the docs.
Fair enough, but ensuring all copies have a link to duplicates where practicable is a good idea. If you get an answer on Twitter tomorrow, people will be able to check that before typing out a new one here.
I’ve been doing some research and I don’t see an easy way to do this with the official Docker Library image (which is what our image is based on). Perhaps running your own MongoDB Docker image with auth enabled is the way to go here.
That is, assuming you’re using the Docker executor. As @halfer mentioned, know what you’re doing and/or with a config would be helpful.
Hi guys. Thanks.
I haven’t posted a config because at the moment I removed the Mongo container from it.
But anyway, yes, I am using CCI2 with Docker executor. I was hoping one could pass a custom mongo config to it…but doesn’t seem to be the case.
Can the mongod binary be started in a custom command, and then key/value config pairs supplied in an option? Or an option supplied to point to a custom config file?
Sure, but could you try something? The syntax for custom commands is here, and I expect you can do mongod --help or man mongod to see how to turn on authentication.