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
cd
into the directory:git clone https://github.com/aeksco/docker_jupyter_mongodb.git
cd docker_jupyter_mongodb
-
Start the docker containers:
docker-compose up
NOTE - 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=8a78623a6eadf3433f0b1ccef1049b2ce525fef20823a12d
Opening 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
MongoDB
notebook to create thejupyter
database and a single examplerestaurant
record
-
This configuration is not optimized for size. The
jupyter/datascience-notebook
has a footprint of 6.28 GB - you could substitute thejupyter/minimal-notebook
(footprint of 2.74 GB) by changing theFROM
statement injupyter/Dockerfile
. -
You may run a command inside the
jupyter
docker 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_EXAMPLE
into/etc/nginx/sites-available/my_site
-
Simlink the file from
sites-available
tosites-enabled
ln -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