Setting up a JupyterLab server with Rstan using Docker

Because setting up the Rstan environment often fails.


Because setting up the Rstan environment often fails.

Dockerfile

1FROM jupyter/datascience-notebook
2
3RUN pip install jupyterlab
4RUN jupyter serverextension enable --py jupyterlab
5RUN jupyter labextension install @jupyterlab/git
6RUN pip install jupyterlab-git
7RUN jupyter serverextension enable --py jupyterlab_git
8
9FROM rocker/tidyverse
10
11# Change environment to Japanese(Character and DateTime)
12ENV LANG ja_JP.UTF-8
13ENV LC_ALL ja_JP.UTF-8
14RUN sed -i '$d' /etc/locale.gen \
15  && echo "ja_JP.UTF-8 UTF-8" >> /etc/locale.gen \
16  && locale-gen ja_JP.UTF-8 \
17  && /usr/sbin/update-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
18RUN /bin/bash -c "source /etc/default/locale"
19RUN ln -sf  /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
20
21# Install Japanese fonts
22RUN apt-get update && apt-get install -y \
23  fonts-ipaexfont
24
25# Install packages
26RUN Rscript -e "install.packages(c('githubinstall','rstan','ggmcmc','bayesplot','brms'))"
27
28RUN jupyter lab --no-browser --port=8888
29

References