Skip to content
Snippets Groups Projects
Commit 89619808 authored by William Bell's avatar William Bell
Browse files

Adding docker-compose.yml together with associated changes

parent fe79711b
No related branches found
No related tags found
No related merge requests found
# Introduction to MongoDB
An introduction to the MongoDB NoSQL database using the Python interface.
An introduction to the MongoDB NoSQL database using the `pymongo` Python module.
* Documentation is given in [doc/introduction-to-mongo.pdf](doc/introduction-to-mongo.pdf).
* Example programs are given in [python/](python/).
* The `docker-compose.yml` file can be used with [docker compose](https://docs.docker.com/compose/) to start MongoDB locally.
```bash
# Start the MongoDB server.
docker compose up
# Press ctrl-c to stop the running server.
# Remove the mongodb container.
docker compose down --rmi local
# Remove the mongodb image from the local PC.
docker compose down --rmi all
```
\ No newline at end of file
......@@ -13,8 +13,8 @@ def get_client():
server = os.getenv('MONGODB_SERVER', 'localhost')
port_str = os.getenv('MONGODB_PORT', '27017')
username = os.getenv('MONGODB_USERNAME', '')
password = os.getenv('MONGODB_PASSWD', '')
username = os.getenv('MONGODB_USERNAME', 'root')
password = os.getenv('MONGODB_PASSWD', 'example')
# The port number should be an integer.
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment