Includes example Jupyter notebook to push data to MongoDB, and a mongo-express admin interface. Runs the Jupyter Data Science Notebook container with an installation of Zipline.
-
Clone this repository and
cdinto the directory:git clone https://github.com/aeksco/docker_jupyter_mongodb.gitcd docker_jupyter_mongodb -
Start the docker containers:
docker-compose upNOTE - there's a unique token you'll need to access the Jupyter notebook server.
The docker-compose terminal will print out a self-authenticating URL, which looks like:
http://localhost:8888/?token=8a78623a6eadf3433f0b1ccef1049b2ce525fef20823a12dOpening that URL will take you to the notebook server.
-
MongoDB admin interface running at http://localhost:8081
-
Jupyter server running at http://localhost:8888
-
Run the
MongoDBnotebook to create thejupyterdatabase and a single examplerestaurantrecord
-
This configuration is not optimized for size. The
jupyter/datascience-notebookhas a footprint of 6.28 GB - you could substitute thejupyter/minimal-notebook(footprint of 2.74 GB) by changing theFROMstatement injupyter/Dockerfile. -
You may run a command inside the
jupyterdocker container as the root user with the following command:docker-compose run --user="root" jupyter pip install pandas
-
Run the following to setup an NGINX reverse-proxy to the Jupyter Notebook server
sudo apt-get update sudo apt-get install nginx -
Copy the contents of
NGINX_EXAMPLEinto/etc/nginx/sites-available/my_site -
Simlink the file from
sites-availabletosites-enabledln -s /etc/nginx/sites-available/my_site /etc/nginx/sites-enabled/my_site -
Control NGINX with the following system commands:
sudo systemctl start nginx sudo systemctl stop nginx sudo systemctl restart nginx