/kz-jpylb

Environment for Jupyterlab with Docker

Primary LanguageJupyter NotebookMIT LicenseMIT

kz-jpylb

Version MIT License Python Python

This repository makes it easy to create an environment fot data-analysis via Docker.

This is a base image

Some people reckon that such an environment is satisfied with JupyterNotebook or Colaboratory. Yes. It's exactly as you thought. However, the actual reason why I did such a hassle thing is for my comprehension of Docker. I am just a one of learners. I wanna confirm if I apprehend the usage of Docker. I think this is gonna be a great opportunity. As I said, however, I am still a beginner. It means there might be some mistakes. Thus, If you have some advice or request, please feel free to leave issues.

Actually, these has nothing to do with this repository, I listed up some useful and pragmatic references when creating this repository as follows:

There are bunch of references because of my lack of competences. Anyway, Thank you very much.

Directory Structure

kz-jpylb
    ┣ work
    ┃   ┣ test1.ipynb        # Example Notebook_01
    ┃   ┗ test2.ipynb        # Example Notebook_02
    ┣ juoyter                # Jupyter Stuffs
    ┃   ┗ Dockerfile
    ┣ kzdb                   # Database Stuffs
    ┃   ┣ ...
    ┃   ┗ kzbase             # Example Table
    ┣ README.md              # Instruction Manual
    ┣ LICENSE
    ┣ my.conf
    ┣ .env.example           # You have to modify, look at a detail below
    ┣ .gitignore
    ┗ docker-compose.yml

1. Installing Docker

General installation instructions are on the Docker site, but we give some quick links here:

2.1 Modify your own UID

Linux/MacOS:

$ echo $UID
501  (yours might be different from mine)

After executing above command, you should follow the instructions:

  1. Open .env.example
  2. Modify UID=501 (this number was acquired above)
  3. Rename .env.example to .env

That's all.

2.2 run a new Docker container

Windows/Linux/MacOS:

$ docker-compose up -d 

This container setup

Package            Version    
------------------ --------
beautifulsoup4     4.7.1   
conda              4.6.8  
matplotlib         3.0.3   
numpy              1.15.4  
pip                19.0.3  
requests           2.21.0 
scikit-image       0.14.2  
scikit-learn       0.20.3  
scipy              1.2.1   
seaborn            0.9.0  
SQLAlchemy         1.3.1 
urllib3            1.24.1  
xgboost            0.82

etc...

3 How to use Jupyter Lab

Copy/paste this URL into your browser when you connect for the first time,

http://localhost:8888/lab/?

if you want to use Jupyter-Notebook

http://localhost:8888/?

4 How to use DataBase

Copy/paste this URL into your browser when you connect for the first time,

http://localhost:8080/

Or, You can also use database as follows:

$ docker-compose exec mysql-kz mysql -uroot -ppassword kzbase

5 End a Docker container

Windows/Linux/MacOS:

$ docker-compose down

This container is CPU Only.If you want to use GPU, rebuilding GPU images requires nvidia-docker.