Fork me on GitHub
#nextjournal
<
2022-02-09
>
JaimeV00:02:53

Hi, I would like to use a block/cell as the render target for docker environment serving content on localhost:8080. Is there a way to do this? Are iframes supported in next journal?

mkvlr16:02:10

Hi, can you change the port? We expose 9998 like for example here https://nextjournal.com/nextjournal/flask

JaimeV16:02:15

I believe so. Below is the command that I use to run it locally.

docker run -it --rm -p 8080:8080 -v $PATH:/usr/local/app containerid
Is there a way to configure the port and $PATH through the environment settings?

JaimeV21:02:41

@U5H74UNSF Hi Martin, I checked the flask example. It seems pretty straight forward. That said, I would like to have an iframe for rendering the content served by the docker image. I don't see a place to configure the port or the path presented to docker. Am I missing something?

mkvlr15:02:21

sorry I dropped this. I believe @U9EQP1K0X should have more samples for this?

Andrea16:02:38

Hi @UF7M6GGDQ, at the moment it’s not possible to configure the port we expose in the runtime (read: the docker container), and at present we only allow some kind of “mounts”. Another (less minimal) example is how to configure a Dash application to have its iframe render correctly: https://nextjournal.com/nextjournal/dash likewise you could try to configure your application to use the 9998 port. Can you share a notebook that we can have a look at to help further?

JaimeV13:02:57

Hi @U9EQP1K0X, I'm trying to use the structurizr-lite container inside an iframe in nextjournal. The instructions provided ask for configuration of the port and mount path. See details at https://dev.to/simonbrown/getting-started-with-structurizr-lite-27d0

Andrea15:02:28

By inspecting the image you pasted here, you can see the command which runs in the container: catalina.sh run. So we might use that manually in a notebook. Gave this a try in a public notebook https://nextjournal.com/zampino/structurizr that you can remix. maybe you don’t need to configure the port but use a service runtime (basically a long running process that can be reached by other runtimes). Try remixing the notebook to play around, the missing part would be to “proxy” catalina server onto a public facing URL (like in the flask app example) from within a — say — python runtime. But it all seems pretty hacky, sorry...