I have a normal rails server already deployed and is running on a ubuntu machine with port 80 for http service.
For the saving cost reason, I would like to run an internal python server on the same ubuntu machine at different port say 8888 and let the rails app call the api that python server expose.
I did this experiment on my local development machine and it worked fine. That is, I have my rails server run at localhost:3000 and python server run at localhost:8888. The rails server can call python api with no issue. However in production environment, I am struggling to make it work.
Any suggestion how should I set up the python server on production so that it can be access by rails server?