Official Django Docker Container Deprecated

168 views
Skip to first unread message

Alexander Lyabah

unread,
Feb 26, 2019, 2:39:34 AM2/26/19
to Django developers (Contributions to Django itself)
Hi guys,

I found out that official django container is deprecated. Why you don't want to support it?

When you search "django" in Python subreddit https://monosnap.com/file/R3uAqdrcrtxjCyKgHhhe7B8lO3up5q

you see "Flask has overtaken Django according to the 2018 JetBrains Developer Survey" https://www.reddit.com/r/Python/comments/ao5dml/flask_has_overtaken_django_according_to_the_2018/

and the main point in this discussion that it is hard to start from 0 to real project.

That why I was surprised that you don't have a simple docker container with configured django with apache or/and django with nginx . It can save so much time for people who just want to launch a simple pet project with 3 visitors per week.

Thank you, I love Django and wish you be better and bigger, have a great week.

Florian Apolloner

unread,
Feb 26, 2019, 10:17:53 AM2/26/19
to Django developers (Contributions to Django itself)


On Tuesday, February 26, 2019 at 8:39:34 AM UTC+1, Alexander Lyabah wrote:
I found out that official django container is deprecated. Why you don't want to support it?

There was never one to begin with.

Tom Forbes

unread,
Feb 26, 2019, 10:28:14 AM2/26/19
to Django developers (Contributions to Django itself)
There never was an official Django image, it was an "official docker" Django image that they maintained. The page image page explains why it was deprecated: https://hub.docker.com/_/django

For most usages of this image, it was already not bringing in django from this image, but actually from your project's requirements.txt, so the only "value" being added here was the pre-installing of mysql-client, postgresql-client, and sqlite3 for various uses of the django framework.

I fully agree with this, it made little sense as an image at all.

Alexander Lyabah

unread,
Feb 27, 2019, 1:32:06 AM2/27/19
to Django developers (Contributions to Django itself)
but the image it self is only using runserver, which means it is only for dev-server.

The requirements.txt can be part of connected volume. So the image contains only django and configured server.

Johannes Hoppe

unread,
Feb 27, 2019, 8:54:37 AM2/27/19
to Django developers (Contributions to Django itself)
I don't think that a Docker image would make local development any easier. I also don't see how that is implied by the reddit post and it's comments.
Looking through the posts, I agree with the assessment, that most people currently lean towards a microservice architecture and therefore towards flask.
For whatever reason, people tend to think you can't build a performant microservice with Django. Anyways, deploying Python applications has always been somewhat difficult. Especially for people coming over from PHP that are used to a LAMP stack.

I think it would be great if Django's documentation would not go so much into the details of WSGI, but give a couple of google example on how to deploy to Heroku, DigitalOcean and the likes of it.

Jamesie Pic

unread,
Feb 27, 2019, 9:31:17 AM2/27/19
to django-d...@googlegroups.com
> most people currently lean towards a microservice architecture and therefore towards flask.
"according to the 2018 JetBrains Developer Survey" and some people.
Why start a project with flask in 2019 instead of Quart which or
Starlette is another question that I suppose is out of the scope of
this mailing list.

Anyway, the point of Docker is to build your own image that supports
both development and production given different runtime parameters.
The agile practice with docker is to build your immutable image in CI,
test it, deploy it to staging, have on-click deployment to production.

The security and best practice documentation from docker are indeed a
lot to grasp, and beginners will most of the time start making
insecure (running as root) and inefficient (fat) images. Therefore for
their security Django might want to document making a docker file,
perhaps based on the alpine image that's the most lightweight.

--

Alexander Lyabah

unread,
Feb 28, 2019, 7:56:26 AM2/28/19
to Django developers (Contributions to Django itself)
I can make a version for production use (in a week or two), for your critics.

For example, based on Appache wsgi.

PS: maybe it is also worth to make a docker image for testing changes in Django source?

Tom Forbes

unread,
Feb 28, 2019, 8:04:08 AM2/28/19
to django-d...@googlegroups.com

I think the point we are trying to make is that it’s fundamentally not a good thing to try and distribute a one-size fits all docker image for a specific framework.

For reference here is one you can use yourself:

FROM python:3
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD [ "gunicorn", "my.app" ]

If someone is unable to make an equivalent Dockerfile then they will be really confused when they realise that they need to customise it, because few projects are as simple as that.

You should also likely not embed Apache inside your app container - it’s kind of missing the general idea of Docker.

To re-iterate: The Django project had no hand in creating the ‘official’ image. The Docker project retired the original Django image for reasons that are clearly explained here, and those reasons still hold today.

Tom

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f07ad32e-e74f-4cd3-945a-ed92692c2209%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kye Russell

unread,
Feb 28, 2019, 9:06:22 AM2/28/19
to django-d...@googlegroups.com
Agreed. As someone that Dockerizes all of their Django development I can speak to how opinionated such an image would HAVE to be.

It can certainly be done, but I don’t think it should.

There is also an implied security / maintenance burden so unfortunately even if it were appropriate, it’s not exactly work that doesn’t come with a clear ongoing commitment. 

Reply all
Reply to author
Forward
0 new messages