mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-16 22:42:57 +00:00
Parameterize healthcheck by internal port (#1859)
* Use the JUPYTER_PORT environment variable to configure server port - Remove port setting in jupyter_server_config.py - Declare the $JUPYTER_PORT env on the base Dockerfile - Use it for HEALTHCHECK * Add test case for JUPYTER_PORT env variable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update style * Better wording * Better wording * Add test for custom internal port * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Parametrize internal port test case * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Try to fix test * Better tests Co-authored-by: Muhammad Aji Muharrom <ajimuharrom@uchicago.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com> Co-authored-by: Ayaz Salikhov <mathbunnyru@gmail.com>
This commit is contained in:

committed by
GitHub

parent
e014bb8ec5
commit
0d324bc0b3
@@ -22,10 +22,16 @@ You can pass [Jupyter server options](https://jupyter-server.readthedocs.io/en/l
|
||||
2. To set the [base URL](https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html#running-the-notebook-with-a-customized-url-prefix) of the notebook server, you can run the following:
|
||||
|
||||
```bash
|
||||
docker run -it --rm -p 8888:8888 jupyter/base-notebook \
|
||||
docker run -it --rm -p 8888:8888 --no-healthcheck jupyter/base-notebook \
|
||||
start-notebook.sh --NotebookApp.base_url=/customized/url/prefix/
|
||||
```
|
||||
|
||||
Note: We pass the `--no-healthcheck` parameter when setting a custom `base_url` for the Jupyter server,
|
||||
because our current implementation for doing healthcheck assumes the `base_url` to be `/` (the default).
|
||||
Without using this parameter, the container may run, but it's state will be "unhealthy".
|
||||
Alternatively, you can [use your own command for healthcheck](https://docs.docker.com/engine/reference/run/#healthcheck)
|
||||
using the `--health-cmd` parameter.
|
||||
|
||||
## Docker Options
|
||||
|
||||
You may instruct the `start-notebook.sh` script to customize the container environment before launching the notebook server.
|
||||
@@ -123,6 +129,8 @@ You do so by passing arguments to the `docker run` command.
|
||||
The variables are unset after the hooks have been executed but before the command provided to the startup script runs.
|
||||
- `-e NOTEBOOK_ARGS="--log-level='DEBUG' --dev-mode"` - Adds custom options to add to `jupyter` commands.
|
||||
This way, the user could use any option supported by `jupyter` subcommand.
|
||||
- `-e JUPYTER_PORT=8117` - Changes the port in the container that Jupyter is using to the value of the `${JUPYTER_PORT}` environment variable.
|
||||
This may be useful if you run multiple instances of Jupyter in swarm mode and want to use a different port for each instance.
|
||||
|
||||
## Startup Hooks
|
||||
|
||||
|
Reference in New Issue
Block a user