MongoDB service dependency auth enabled?


Any help with the below:

Use MongoDB service dependency image with --auth option, to enable authentication, add admin user and app user, then app connect to MongoDB service dependency using authentication?

Anybody else think it is absolutely necessary to enable auth during the CI build pipeline?

Do you just leave your database instance open and with auth not enabled during CI build pipeline?

Thank you

Typically when you are using mongo in your pipeline, you are declaring it as a service container. In the below example, the service container is attached to an isolated bridge network, and is only accessible to the pipeline steps. It is not accessible to other docker containers on the machine, or to the outside world. The service container is also ephemeral, and will be deleted when the pipeline completes.

So taking into account all of the above, I would not recommend enabling authentication unless you need to for specific test cases.

    image: mongo:3.0
      - sleep 15
      - mongo --host mongo --eval "{ ping: 1 }"

    image: mongo:3.0
    command: [ --smallfiles ]
1 Like