How to create user in mongodb with docker-compose

后端 未结 8 1189
天命终不由人
天命终不由人 2020-12-23 20:28

I\'m trying to create some kind of script that will create a docker with mongodb and automatically create a user.

I can usually manage my docker images with docker-c

8条回答
  •  悲&欢浪女
    2020-12-23 20:54

    Mongo image provides the /docker-entrypoint-initdb.d/ path to deploy custom .js or .sh setup scripts.

    Check this post to get more details : How to create a DB for MongoDB container on start up?

提交回复
热议问题