This project is an example of how to use docker-compose for spinning up a development jupyter notebook service and a local MongoDB populated with development data
- docker-compose.yml is the docker-compose file where the services are defined. It is seperated in three services:
- mongodb: The MongoDB
- mongodbsetup: The service that populates the MongoDB
- jupyter: The service that spins up a jupyter notebook which can be used for development
- notebooks/pymongo_examples.ipynb is a jupyter notebook with examples on how you can use pymongo to ready and work with the data from your MongoDB
- data contains some sample data for the MongoDB
- src/load_mongo_data.sh is the bash script for importing data from data/ into the MongoDB
- .env is the place to specify your environment variables for the docker containers
The docker-compose file ..
- First build the image
docker-compose build
- Then start the service (-d flag detaches the container and makes it run in the background)
docker-compose up
- Now you can access the jupyter notebook service on localhost port 8888, just copy paste the url you see in the terminal
http://127.0.0.1:8888/?token=..
into your browser - Finally, when you are done take down the services
docker-compose down