Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Not production ready #5

Closed
tback opened this issue Mar 20, 2015 · 6 comments
Closed

Not production ready #5

tback opened this issue Mar 20, 2015 · 6 comments

Comments

@tback
Copy link

tback commented Mar 20, 2015

The django documentation clearly states not use runserver in production:

DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making Web frameworks, not Web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)
https://docs.djangoproject.com/en/1.7/ref/django-admin/#runserver-port-or-address-port

@daghack
Copy link
Contributor

daghack commented Mar 20, 2015

You are correct - when using Django in production, you normally run it with something like uWSGI. When deploying from containers, this doesn't change. That does not mean that the image is not production ready, but rather that it is expected you use the django image in conjunction with a correctly configured web server.

@daghack daghack closed this as completed Mar 20, 2015
@psftw
Copy link

psftw commented Mar 20, 2015

Good point. This should definitely be called out in the django image documentation. While I don't think it is appropriate to spell out how to deploy for production (because there is no one solution that solves everyone's needs), it would certainly be useful to refer to the upstream documentation on the matter: https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ . This documentation talks about three basic options: Apache + mod_wsgi, uWSGI, and Gunicorn. In order to enhance the documentation for the django image further, we could briefly mention what these options would look like in a Docker context.

For the Apache + mod_wsgi option, one could read up about it from the creator himself http://blog.dscpl.com.au/2014/12/hosting-python-wsgi-applications-using.html. Maybe we reference that page. Maybe we enhance the existing django repository with a new tag specific to that workflow. Maybe we simply distill the ideas there down in to basic recommendations. I would defer to the experts here.

The uWSGI and Gunicorn options would just require additional python packages to install and some recommendations on how to override the CMD to utilize them (I think)?

@tianon
Copy link
Member

tianon commented Mar 20, 2015

Filed an issue so we keep track of it: docker-library/docs#189 👍

@psftw
Copy link

psftw commented Mar 20, 2015

@tianon beating me to it, TSKTSK 🐌

@tback
Copy link
Author

tback commented Mar 20, 2015

@Moghedrin no, adding a reverse proxy doesn't change that. django-admin runserver is not meant for production, neither directly nor behind a reverse proxy. django is usually hosted through uwsgi, gunicorn or some other python webserver.

@daghack
Copy link
Contributor

daghack commented Mar 20, 2015

@tback My brain had a dump on me - it hadn't had it's coffee yet. I said nginx, what I meant to say was "properly configured webserver". You're completely correct in that nginx, while helpful in general, would not be the solution here. I'll edit my comment accordingly!

+1 on adding examples of configuring the image to sit behind one of these webservers in the django image documentation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants