Jupyter lab does not continue when run from docker container

I’m a bit lost: when I install jupyter lab natively in a virtual env I can access it on localhost just fine. No issues.

When I try to run jupyter lab from a self made docker container (python 3.12 image + installing jupyter packages and all the rest I need), the browser keeps trying, but the notebook never starts. What am I missing here?

jupyter notebook --allow-root --port 9002
[I 2026-02-17 13:26:56.159 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2026-02-17 13:26:56.162 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2026-02-17 13:26:56.165 ServerApp] jupyterlab | extension was successfully linked.
[I 2026-02-17 13:26:56.169 ServerApp] notebook | extension was successfully linked.
[I 2026-02-17 13:26:56.517 ServerApp] notebook_shim | extension was successfully linked.
[I 2026-02-17 13:26:56.530 ServerApp] notebook_shim | extension was successfully loaded.
[I 2026-02-17 13:26:56.531 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2026-02-17 13:26:56.532 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2026-02-17 13:26:56.534 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.11/site-packages/jupyterlab
[I 2026-02-17 13:26:56.534 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 2026-02-17 13:26:56.534 LabApp] Extension Manager is 'pypi'.
[I 2026-02-17 13:26:56.562 ServerApp] jupyterlab | extension was successfully loaded.
[I 2026-02-17 13:26:56.565 ServerApp] notebook | extension was successfully loaded.
[I 2026-02-17 13:26:56.566 ServerApp] Serving notebooks from local directory: /app
[I 2026-02-17 13:26:56.566 ServerApp] Jupyter Server 2.17.0 is running at:
[I 2026-02-17 13:26:56.566 ServerApp] http://localhost:9002/tree?token=73a6f76210dd460d9da665065e369c8726d20b6d5fe01812
[I 2026-02-17 13:26:56.566 ServerApp]     http://127.0.0.1:9002/tree?token=73a6f76210dd460d9da665065e369c8726d20b6d5fe01812
[I 2026-02-17 13:26:56.566 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2026-02-17 13:26:56.573 ServerApp] No web browser found: Error('could not locate runnable browser').
[C 2026-02-17 13:26:56.573 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/jpserver-40-open.html
    Or copy and paste one of these URLs:
        http://localhost:9002/tree?token=73a6f76210dd460d9da665065e369c8726d20b6d5fe01812
        http://127.0.0.1:9002/tree?token=73a6f76210dd460d9da665065e369c8726d20b6d5fe01812
[I 2026-02-17 13:26:56.585 ServerApp] Skipped non-installed server(s): basedpyright, bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyrefly, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server

What is your docker run command look like?

Additional context for that query:
See Kaiwen’s comment here.
Note the CMD and docker run command in Setting Up and Running Jupyter Notebook in a Docker Container.