0

I have three products, and want to host them on my server.

I am not sure how do I deploy them. From the reach I have done, I understand there are two ways.

  1. Deploy each product on different port

http://3.18.21.199:5001/twiiter http://3.18.21.199:5002/summary http://3.18.21.199:5003/sentiment

  1. Deploy each on same port with different route.

http://3.18.21.199:5000/twiiter http://3.18.21.199:5000/summary http://3.18.21.199:5000/sentiment

Can I get suggestion from flask geek,. That what is the correct way.

Also when we launch product, it's not preferable that we give link with port number. Like

3.18.21.199:5001/twiiter 3.18.21.199:5002/summary 3.18.21.199:5003/sentiment

Ideally it should be

3.18.21.199/twiiter 3.18.21.199/summary 3.18.21.199/sentiment

How can we achieve this?

user2129623
  • 2,167
  • 3
  • 35
  • 64

1 Answers1

0

I don't think that it is possible to run two apps on one port. Using a reverse-proxy won't really work since it won't know which app to forward the request to.

What you will have to do is run them on different ports, other then that what you can try to do(given the 3 apps are small) is to combine them into one app using blueprints. Another way you can go about doing this is to do subdomains so like:

twitter.3.18.21.199.com sentiment.3.18.21.199.com summary.3.18.21.199.com

to achieve this first you will have to spin up three Gunicorn processes one three different ports, then setup the Nginx reverse-proxy following this video then this question

the most ideal setup for you is to just combine those three apps however.

Arjun
  • 358
  • 5
  • 14