Hi Anssi,
Not really an answer to your question, but just to give you insight to a
solution.
We at l1nda are using docker and django with small applications and
large applications.
We developed an nginx container and uwsgi container and a devops
container. The devops container does all the tricky parts and the nginx
and uwsgi containers are basically simple ones.
We have automated the deployment docker (devops) image that internally
uses docker-py that will minimize the downtime of the django containers.
The script is just a python file of 100 lines that brings application
down and up in a redundant way it also starts the staticscollecting etc.
As it is pulling the images from another server (at our office), the
security hurden is small.
1. Pull new images from our private repository
2. Collect statics, update databases etc.
3. loop per container [we run every application in 4 different containers]
3.1 stop old container
3.2 start new container.
We use a shared FS (NFS) for sharing the resources (uwsgi is allowed to
write to the FS and the nginx is only allowed to read from the FS. The
machine that contains the nginx image is also hosting the FS.
Jeroen
On 01/08/2015 11:45 AM, Anssi Kääriäinen wrote:
For a long time I have been battling with the following problem: how
to deploy Django in an easy, maintainable, secure and reliable way for
small Django applications. The applications I write are mainly very
low traffic, and often they are coded in a couple of days.
Unfortunately the hardest part of producing these applications has
been deployment. A big part of the problem is that I have to work with
RHEL6 based servers, and those tend to have old libraries.
The solution I am currently using is a nice little setup helper I
wrote, django-dockerfile:
https://github.com/akaariai/django-dockerfile. The idea is that you
write a environment file for each server you want to deploy into, and
after that everything happens automatically through usage of fab.
The solution works great for me even if there is still a lot to do.
For example, usage of the fig package could make the code more robust,
and allow for multi-server installations.
The main reason I am writing here on django-users is that I would like
to see an easy way to deploy small Django applications. For large
applications it seems OK to just build up your own deployment
strategy, but for small applications it is too easy to end up doing
the deployment in a hackish way where for example deploying the
application isn't scripted, and each application's deployment strategy
varies slightly.
I am looking for a way to deploy Django with at least these features:
- Allows one-command deployment directly from Git to Docker-enabled
server
- Easy to use and get started
- Doesn't use development server, or SQLite as database.
- Does care for security
- Media and static files served properly (note: CDN is overkill for
my projects!)
- Allows one to define secrets and other environment variables per
installation
- Preferably: logging, backup and restore thought out
The django-dockerfile package has the above features except for
logging, backup and restore.
So, if there already exists something that has the above features
implemented, then please tell me. If not, I am looking for interested
developers to participate in building a tool for the small Django
project deployment use case. The django-dockerfile package could be
used as basis for the work, but using some other package or just
starting from scratch are also options. Just writing a blog post that
has information about an example Django deployment with every aspect
of the above feature list covered could be enough.
- Anssi
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/eeb24be3-1f3d-4d4e-8ba0-7a476871c43a%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/eeb24be3-1f3d-4d4e-8ba0-7a476871c43a%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
*L1NDA B.V.*
*www.l1nda.nl <http://www.l1nda.nl/>*
*www.facebook.com/L1NDA.NL <http://www.facebook.com/L1NDA.NL>
* Nieuwezijds Voorburgwal 101-III
1012 RG, Amsterdam
020-7526690
KvK: 57861765
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/54AE75EF.2020209%40l1nda.nl.
For more options, visit https://groups.google.com/d/optout.