How to execute a transformers python script through nodejs and containerize it?

I have a text statement in nodejs which i want to send to python,apply transformers and process it and then retrieve the processed text back into nodejs. Then to write a dockerfile and containerise the integrated code into a single container. The dockerfile,python script and nodejs codes are attached.
The dockerfile code

I tried experimenting using multi-stage builds in dockerfile,to install python on node image and vice versa.Am able to get a simple text output from the python code in the absence of the transformers library.Once i use it the container just exits after running the nodejs code but no output from the python code.

Thank you for the help! kudos

You need to make sure that the nodejs app runs in the foreground to keep the container alive. If it does and you don’t have any output before the container stops, you could try to debug by running a container from the same image but use “bash” as command and run the nodejs commands in bash to see what happens.

For more instructions I recommend you a blog post based on my presentation on the 6th Docker Community All-Hands. You can alos find the video in the blog post: