I am setting up a mongodb container. My web application will run in another container. Somehow, while building the mongodb image, I need to run fixture script that will generate password hash for the default user and will be inserted into the mongodb. The fixture script is written in python and uses bcrypt to generate hash. I haven't found ways to run python script in the mongodb container. Am I doing it the right way or are there any other better ways to achieve this.
The mongodb container likely doesn't have python installed -- in general, containers have the minimal amount of dependencies needed to accomplish their goal.
I think you have a couple options here: