Skip to content

Commit aa14e44

Browse files
authored
Merge pull request #1660 from mathbunnyru/asalikhov/add_healthcheck
Add healthcheck command to Dockerfile
2 parents 6226ae0 + 9ee6670 commit aa14e44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

base-notebook/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ RUN sed -re "s/c.ServerApp/c.NotebookApp/g" \
171171
/etc/jupyter/jupyter_server_config.py > /etc/jupyter/jupyter_notebook_config.py && \
172172
fix-permissions /etc/jupyter/
173173

174+
# HEALTHCHECK documentation: https://docs.docker.com/engine/reference/builder/#healthcheck
175+
# This healtcheck works well for `lab`, `notebook`, `nbclassic`, `server` and `retro` jupyter commands
176+
# https://github.com/jupyter/docker-stacks/issues/915#issuecomment-1068528799
177+
HEALTHCHECK --interval=15s --timeout=3s --start-period=5s --retries=3 \
178+
CMD wget -O- --no-verbose --tries=1 http://localhost:8888/api || exit 1
179+
174180
# Switch back to jovyan to avoid accidental container runs as root
175181
USER ${NB_UID}
176182

0 commit comments

Comments
 (0)