Mongo DB in Docker
Run a MongoDB Instance with Docker or Docker Compose
Updated: 03 September 2023
Considerations
To run MongDB in a Docker Container there are a few things to take note of:
- You may need to configure auth
- Volume storage to be set up
From Terminal
To run a Docker container using a single command in the terminal you can run the following command:
You can also specify additional information like the volumes you would like to use using flags when running:
From Compose
More info can be found here
You can also run a MongoDB Container with Compose which may be a bit easier:
docker-compose.yml