There's no magic here. If your notebook depends on pandas, some special env var, some local JPEG images, etc., you need to ensure the kernel gateway providing the kernel for the dashboard has pandas, that you start it with the same environment variable, that you bundle your JPEG images with your notebook, etc. Some of this is automated by the dashboard bundling process. But other parts, namely resolving kernel-side dependencies, is still a manual process.
That said, using the same Docker image between notebook server and kernel gateway and putting one-off pip/conda commands right in the notebook for eval on first run can take you a long way without much hassle in my experience.