|
52 | 52 | "conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab=1.2' 'nodejs=11' python-language-server\n",
|
53 | 53 | "# Also consider: r-languageserver [*]\n",
|
54 | 54 | "source activate lsp\n",
|
55 |
| - "pip install jupyter_lsp=0.7 --no-deps\n", |
56 |
| - "jupyter lab build\n", |
| 55 | + "python -m pip install 'jupyter_lsp=0.7' --no-deps\n", |
| 56 | + "jupyter labextension install '@krassowski/[email protected]'\n", |
| 57 | + "```\n", |
| 58 | + "\n", |
| 59 | + "Then run\n", |
| 60 | + "\n", |
| 61 | + "```bash\n", |
57 | 62 | "jupyter lab\n",
|
58 |
| - "```" |
| 63 | + "```\n", |
| 64 | + "\n", |
| 65 | + "Your browser should open to your local server." |
59 | 66 | ]
|
60 | 67 | },
|
61 | 68 | {
|
|
65 | 72 | "#### docker (data science)\n",
|
66 | 73 | "\n",
|
67 | 74 | "This approach is based roughly on the\n",
|
68 |
| - "[Jupyter docker-stacks documentation](https://github.com/jupyter/docker-stacks/tree/master/examples/docker-compose/notebook)." |
| 75 | + "[Jupyter docker-stacks documentation](https://github.com/jupyter/docker-stacks/tree/master/examples/docker-compose/notebook),\n", |
| 76 | + "which should be consulted for more about connecting volumes, passwords, and\n", |
| 77 | + "other advanced features:" |
69 | 78 | ]
|
70 | 79 | },
|
71 | 80 | {
|
|
75 | 84 | "##### `Dockerfile`\n",
|
76 | 85 | "\n",
|
77 | 86 | "```dockerfile\n",
|
78 |
| - "FROM jupyter/datascience-notebook:18ef2702c6a2\n", |
| 87 | + "# This already contains the python, r, julia, and nodejs runtimes as well as jupyterlab 1.25\n", |
| 88 | + "FROM jupyter/datascience-notebook@sha256:73a577b006b496e1a1c02f5be432f4aab969c456881c4789e0df77c89a0a60c2\n", |
79 | 89 | "\n",
|
80 | 90 | "RUN conda install --quiet --yes --freeze-installed \\\n",
|
81 |
| - " 'jupyterlab=1.2' \\\n", |
82 |
| - " 'nodejs=11' \\\n", |
83 |
| - " 'python-language-server' \\\n", |
84 |
| - " 'r-languageserver' \\\n", |
85 |
| - " && pip install \\\n", |
86 |
| - " 'jupyter_lsp=0.7' \\\n", |
87 |
| - " && conda clean --all -f -y \\\n", |
88 |
| - " && fix-permissions \"$CONDA_DIR\" \\\n", |
89 |
| - " && fix-permissions \"/home/$NB_USER\" \\\n", |
90 |
| - " && jupyter lab build \\\n", |
91 |
| - " && jlpm cache clean \\\n", |
92 |
| - " && rm -rf \"$CONDA_DIR/share/jupyter/lab/{staging}\"\n", |
| 91 | + " 'python-language-server' \\\n", |
| 92 | + " 'r-languageserver' \\\n", |
| 93 | + " && python3 -m pip install --no-cache-dir --no-deps \\\n", |
| 94 | + " 'jupyter_lsp==0.7' \\\n", |
| 95 | + " && jupyter labextension install --no-build \\\n", |
| 96 | + " '@krassowski/[email protected]' \\\n", |
| 97 | + " && jupyter lab build --dev-build=False --minimize=True \\\n", |
| 98 | + " && conda clean --all -f -y \\\n", |
| 99 | + " && rm -rf \\\n", |
| 100 | + " $CONDA_DIR/share/jupyter/lab/staging \\\n", |
| 101 | + " /home/$NB_USER/.cache/yarn \\\n", |
| 102 | + " && fix-permissions $CONDA_DIR \\\n", |
| 103 | + " && fix-permissions /home/$NB_USER\n", |
93 | 104 | "```"
|
94 | 105 | ]
|
95 | 106 | },
|
|
103 | 114 | "version: '2'\n",
|
104 | 115 | "\n",
|
105 | 116 | "services:\n",
|
106 |
| - " notebook:\n", |
| 117 | + " lsp-lab:\n", |
107 | 118 | " build: .\n",
|
108 |
| - " image: jupyterlab-lsp-notebook\n", |
109 |
| - " container_name: ${NAME}\n", |
110 |
| - " volumes:\n", |
111 |
| - " - 'work:/home/jovyan/work'\n", |
112 | 119 | " ports:\n",
|
113 |
| - " - '${PORT}:8888'\n", |
114 |
| - " environment:\n", |
115 |
| - " USE_HTTPS: 'yes'\n", |
116 |
| - " PASSWORD: ${PASSWORD}\n", |
117 |
| - "\n", |
118 |
| - "volumes:\n", |
119 |
| - " work:\n", |
120 |
| - " external:\n", |
121 |
| - " name: ${WORK_VOLUME}\n", |
| 120 | + " - '18888:8888'\n", |
122 | 121 | "```"
|
123 | 122 | ]
|
124 | 123 | },
|
|
129 | 128 | "##### Build and Start\n",
|
130 | 129 | "\n",
|
131 | 130 | "```bash\n",
|
132 |
| - "PORT=8899 NAME=lsp PASSWORD=change-me-silly WORK_VOLUME=. docker-compose up\n", |
133 |
| - "```" |
| 131 | + "docker-compose up\n", |
| 132 | + "```\n", |
| 133 | + "\n", |
| 134 | + "You should now be able to access `http://localhost:18888/lab`, using the `token`\n", |
| 135 | + "provided in the log." |
134 | 136 | ]
|
135 | 137 | },
|
136 | 138 | {
|
|
0 commit comments