LoginSignup
1
3

More than 3 years have passed since last update.

jupyterをdocker-composeで起動1

Last updated at Posted at 2020-07-06

はじめに

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

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

ファイル

docker-compose.yml

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

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環境を構築していきたいと思います。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3