Exposing Ports

You can expose TCP ports to the outside world by specifying the ports you want to expose in the ports parameter.

ports accepts a list, so you can expose multiple ports too.

In the example below, we expose two ports:

  • 8888 for a Jupyter Notebook server
  • 3000 for a separate application or web server
from beam import Image, Pod

pod = Pod(
    image=Image(base_image="jupyter/base-notebook:latest"),
    ports=[8888, 3000],
    entrypoint=["start-notebook.py"],
)

Once your Pod is running, both ports will be available at a public URL.