Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django and apache on different dockers

We have an application written in django. We are trying a deployment scenario which will have one docker running apache, the second docker running django and the third docker running the DB server. In most of the documentation it is mentioned that apache and django will sit on the same machine (django in virtualenv to be precise), is there any way we can ask apache to talk to mod_wsgi sitting on a remote machine which has the django application?

like image 629
Sudip Avatar asked Sep 27 '22 02:09

Sudip


1 Answers

mod_wsgi would be the wrong technology if you want to do this. It runs as part of Apache itself, so there literally is nothing to run in the Django container.

A better way would be to use gunicorn to run Django in one container, and have the other running the webserver as a proxy - you could use Apache for this, although it's more common to use nginx.

like image 167
Daniel Roseman Avatar answered Oct 11 '22 17:10

Daniel Roseman