Skip to main content

Mongodb

MongoDB is a popular document database.
Below you can find a basic example to deploy a mongodb server using their official docker image:


Copy past the previous content and save it under a file called mongodb.yml.
Then execute the following command to startup a mongodb server:

nanocl state apply -s mongodb.yml -- --password my_root_password --volume /opt/mongodb
tip

Other cargo created in the same namespace global will be able to connect to the mongodb using is key mongodb.global.c The key can be predicted and caculated, it's formated this way: cargo_name.namespace_name.c|v c stand for container and v for virtual machine. This allow us to have the same name for virtual machine and containers.