はじめに

今回は、jupyterのdockerイメージ(scipy-notebook)をベースにjupyter pluginも入れて、
docker-composeを使ってイメージの作成と起動しました。

ソースは github にあげてあります。

ファイル

docker-compose.yml

version: '3'  
services:  
  jupyter:  
    build:
      context: .
    environment:  
      JUPYTER_ENABLE_LAB: "yes" 
    ports:  
      - "8888:8888"  
    volumes:  
      - ./.jupyter:/home/jovyan/.jupyter
      - ./notebook:/home/jovyan/notebook

Dockerfile

# jupyter lab      : 2.1.3
FROM jupyter/scipy-notebook:54462805efcb

RUN jupyter labextension install \
  @lckr/jupyterlab_variableinspector \
  @krassowski/jupyterlab-lsp \
  @axlair/jupyterlab_vim

# pd.read_html
RUN pip install lxml html5lib beautifulsoup4

# code completion
RUN pip install jupyter-lsp python-language-server[all]

RUN jupyter lab build

jupyter_notebook_config.py

c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.notebook_dir = './notebook'
c.NotebookApp.open_browser = False
c.NotebookApp.token = ''

アクセス

終わりに

jupyterですぐ試してみたい場合などで便利でした。
jupyter plugin周りは全般にメンテナンスがされていない感じがして、
かなり地雷がありました。

次回はdockerのイメージをpythonにしてjupyter lab環境を構築していきたいと思います。

bannerAds