0

Is there a way to run a Python server that uses WSGI bindings directly? I am trying to go with the one process per container philosophy which will naturally get rid of Apache/NGINX from the container and just run a python process. Is there a way to run python server directly with WSGI bindings without using Apache or NGINX?

https://www.quora.com/unanswered/Is-there-a-way-to-run-a-Python-WSGI-server-directly-without-Apache-or-NGINX

1

This question doesn't really make sense - WSGI is the mechanism that a web server such as Apache would use to invoke an application or script, such as something written in Python. If you have no web server, then what would be using WSGI in the first place?

Is the question really, how do I take a pre-existing WSGI application and turn it into a standalone? Flask is one such framework that can run as WSGI or using its own internal web server.

But, taking a step back, I still think this is the wrong question. There is no need to blindly apply the "one process per container philosophy" - which is really just some random person's opinion, at the end of the day - if it doesn't make sense in your use case. Think about it for a second. A container containing one process is just... a process. We already had those. Containers work best for bundling things together that logically belong together and administering them as a single "thing". What's inside them should be completely opaque to who- or whatever is managing them. You will never see developers jumping through hoops to follow a "one shared object per executable philosophy" because that doesn't make sense either!

If you have something that already works well with Apache/Nginx fronting your application, then containerize it that way, it will be fine.

1
  • putting apache or nginix in the container is not only redundant, it makes the image 2x as big in terms of bits, and makes our Dockerfile much harder to maintain. horrible answer.
    – MrCholo
    Oct 14 '19 at 18:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.