Re: Django with Docker

2019-04-30 Thread Andréas Kühne
Hi Omer,

I deploy using the latest version of the 3.7 python docker image. Then we
add all of the requirements into the docker container - without a virtual
environment. Because the docker image will only run the django application,
there is no need for creating a virtual environment. If I need another
application I create another docker image.

Hope this answers your questions.

Regards,

Andréas


Den mån 29 apr. 2019 kl 17:19 skrev Omer Ozsakarya :

> Hello all,
>
> How are you deploying your Django applications with Docker?
> 1- Which packages, libraries are you writing into docker compose file?
> 2- Are you also using a virtual environment with docker?
>
> Thanks
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACGWYAFpn4XxxGjvAKkKsPi_YjYYzdzY17zrs1%3DfGKCAKMm1fA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACGWYAFpn4XxxGjvAKkKsPi_YjYYzdzY17zrs1%3DfGKCAKMm1fA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcbQc8U1yk0dAtXDM5fBrojem9E526tUcXVC5KGojD6jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django with Docker

2019-04-29 Thread Nick Sarbicki
Hi Omer,

Docker actually has docs on this itself:
https://docs.docker.com/compose/django/

- Nick


On Mon, Apr 29, 2019 at 4:19 PM Omer Ozsakarya 
wrote:

> Hello all,
>
> How are you deploying your Django applications with Docker?
> 1- Which packages, libraries are you writing into docker compose file?
> 2- Are you also using a virtual environment with docker?
>
> Thanks
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACGWYAFpn4XxxGjvAKkKsPi_YjYYzdzY17zrs1%3DfGKCAKMm1fA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACGWYAFpn4XxxGjvAKkKsPi_YjYYzdzY17zrs1%3DfGKCAKMm1fA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGuvt93J5MbJqxjP6%3DfWn%3DRU_%3D0OyCu6vNFQdLNta4ZuDnAQnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django with Docker

2019-04-29 Thread Omer Ozsakarya
Hello all,

How are you deploying your Django applications with Docker?
1- Which packages, libraries are you writing into docker compose file?
2- Are you also using a virtual environment with docker?

Thanks

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACGWYAFpn4XxxGjvAKkKsPi_YjYYzdzY17zrs1%3DfGKCAKMm1fA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django wagtial docker production and staging database

2019-01-29 Thread Tim Vogt
Hi I have a wagtail application running on digital ocean,
Deployed with ansibble and docker (separate)

When I used amazon I had staging and production branches in my git 
environment (for small flask projects). 
Now I user docker and try tor find a way to handle the settings.py for 
staging with local database sqllite and for production postgres.

I found out how to implement postgres. settings.dev.py 
settings.production.py, but how to trigger the settings.production.py and 
how to trigger the local settings.dev.py?

So that the local database is data is not passing over to the production 
postgres database?

Do I set it up in my yml file? Or do I use a cli command? 
Tim

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/83c44a37-9eb9-4f5b-85a9-dc3833c93637%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django in docker

2016-07-06 Thread Larry Martell
I ended up fixed it. Turned out one of the dirs in the path was not
readable. That is, the django app was in /foo/bar/baz and although
/foo and /foo/bar/baz were readable, /foo/bar was not. Once I chmod-ed
that all was well.

On Tue, Jul 5, 2016 at 7:13 PM, Josh Crompton <josh.cromp...@gmail.com> wrote:
> Rather than making everything world-readable, I usually create a user
> and chown all the directories to that user.
>
> Can you post your Dockerfile?
>
> On Wed, Jul 6, 2016 at 5:28 AM, Larry Martell <larry.mart...@gmail.com> wrote:
>> I am trying to run nginx/uwsgi/django in a docker container. If I
>> mount the dir with my django project in the container when I create
>> the container it works fine. But I want to make the image
>> self-contained and not dependent on the local file system. So I
>> changed the Dockerfile to copy the dir containing the django project
>> from the host machine into the image. But then, when I create the
>> container (without mounting the dir) I get permission denied on all
>> accesses to that dir (e.g. the socket, the static files, ...).
>> Everything is world readable and executable. Anyone have any clues as
>> to what could be causing this?

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY5_0kXKpq1hZVs9aBviXZPkGwt3uuA44ZZ9G4DezEOTAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django in docker

2016-07-05 Thread Josh Crompton
Rather than making everything world-readable, I usually create a user
and chown all the directories to that user.

Can you post your Dockerfile?

On Wed, Jul 6, 2016 at 5:28 AM, Larry Martell <larry.mart...@gmail.com> wrote:
> I am trying to run nginx/uwsgi/django in a docker container. If I
> mount the dir with my django project in the container when I create
> the container it works fine. But I want to make the image
> self-contained and not dependent on the local file system. So I
> changed the Dockerfile to copy the dir containing the django project
> from the host machine into the image. But then, when I create the
> container (without mounting the dir) I get permission denied on all
> accesses to that dir (e.g. the socket, the static files, ...).
> Everything is world readable and executable. Anyone have any clues as
> to what could be causing this?
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CACwCsY7Pz7mtEBR%3DKNfwC9AX8WtcvJAutAH-ZMkG9HBYS04Ksw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKoVLMjyCrnhe24iioOehweC725NomjffUNnXaJNonV5AA62gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django in docker

2016-07-05 Thread Larry Martell
I am trying to run nginx/uwsgi/django in a docker container. If I
mount the dir with my django project in the container when I create
the container it works fine. But I want to make the image
self-contained and not dependent on the local file system. So I
changed the Dockerfile to copy the dir containing the django project
from the host machine into the image. But then, when I create the
container (without mounting the dir) I get permission denied on all
accesses to that dir (e.g. the socket, the static files, ...).
Everything is world readable and executable. Anyone have any clues as
to what could be causing this?

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY7Pz7mtEBR%3DKNfwC9AX8WtcvJAutAH-ZMkG9HBYS04Ksw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django inside Docker

2016-06-06 Thread Davi Diório Mendes
Ezequiel helped me at hangouts.

at settings.py I had:
TEMPLATES: [
{
[...]
'DIRS': ['templates']
[...]
},
]

and as Ezequiel said, is better to use:
'DIRS': [os.path.join(BASE_DIR, 'templates')]

now everything is working,

Thank you Ezequiel, and everyone that helped me here.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/88a4f667-e5a8-403c-a5cc-ef576a9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django inside Docker

2016-06-06 Thread Davi Diório Mendes
Hi, sorry the late response

Ezequiel, this docker will run on an IBM PowerPC and there is no base image 
ready to ppc64 architecture.
Soon this dockerfile will be ported to ppc64.

Akhil, I use this snippet to run the image
docker run -d --name ltc-client \
-v $(PROJ_HOME)/client:/home/client \
ddiorio/ltc-client:latest

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d3ad3cd-a7ce-4f75-8717-c888785cb093%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django inside Docker

2016-06-04 Thread Akhil Lawrence
No where in the dockerfile you are copying your project files or mounting 
external file system.. Are you doing those at runtime with the help of 
docker compose or fig?
If yes paste those code snippets also.. 




On Saturday, 4 June 2016 02:44:55 UTC+5:30, Davi Diório Mendes wrote:
>
> Hi everyone,
>
> I was developing with django localy, in my laptop, and my manager asked to 
> project run inside a docker.
>
> I did and now django can't find my templates :(
>
> I appreciate any help, my Dockerfile is attached.
>
> BR.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/578cc478-8be9-4cca-bd94-03be686ce568%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django inside Docker

2016-06-03 Thread Ezequiel Bertti
Why didn't you use image from official django.

https://hub.docker.com/_/django/

FROM django:onbuild




On Fri, Jun 3, 2016 at 5:49 PM, Davi Diório Mendes 
wrote:

> Hi everyone,
>
> I was developing with django localy, in my laptop, and my manager asked to
> project run inside a docker.
>
> I did and now django can't find my templates :(
>
> I appreciate any help, my Dockerfile is attached.
>
> BR.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4eb16ab5-21d0-4c69-abdf-96f614cee3f4%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Ezequiel Bertti

https://telegram.me/ebertti
https://twitter.com/ebertti
https://github.com/ebertti

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACrQMYo50RrdPMkMkpjPX_zhT-iOhi1OCk3erv3ZL4zaEMaS2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django inside Docker

2016-06-03 Thread Larry Martell
You could try posting on the docker forum: https://forums.docker.com

On Fri, Jun 3, 2016 at 4:49 PM, Davi Diório Mendes
 wrote:
> Hi everyone,
>
> I was developing with django localy, in my laptop, and my manager asked to
> project run inside a docker.
>
> I did and now django can't find my templates :(
>
> I appreciate any help, my Dockerfile is attached.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY6ku5aVdenkF8PRqUsixLZFohNwq3eirXj4Jn3AXjUcoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django inside Docker

2016-06-03 Thread Davi Diório Mendes
Hi everyone,

I was developing with django localy, in my laptop, and my manager asked to 
project run inside a docker.

I did and now django can't find my templates :(

I appreciate any help, my Dockerfile is attached.

BR.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4eb16ab5-21d0-4c69-abdf-96f614cee3f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dockerfile
Description: Binary data


Re: Deploying Django on Docker

2015-01-12 Thread Aaron C. de Bruyn
My docker setup is pretty easy:

wget -qO- https://raw.github.com/progrium/dokku/v0.3.13/bootstrap.sh |
sudo DOKKU_TAG=v0.3.13 bash

cat ~/.ssh/id_rsa.pub | ssh r...@mynewhost.mydomain.tld "sudo
sshcommand acl-add dokku myproject"

git remote add production do...@mynewhost.mydomain.tld:myproject

git push production master


Dokku is awesome.  ;)



On Sun, Jan 11, 2015 at 10:24 PM, Anssi Kääriäinen  wrote:
> I have given this issue a bit more thought, and it seems using Docker might
> be a bit too complex for the "just completed tutorial use case". Docker is
> nice, but if things do not work out the way you want, troubleshooting can
> get a bit complex.
>
> Instead it might be good to *fully* document how to set up a virtual machine
> based Django setup. The documentation should include:
>   - minimal information about how to install virtualbox and Ubuntu 14.04
> image. (Maybe vagrant would be a better idea?)
>   - how to setup Django with Gunicorn (is supervisord a good idea for
> process management?)
>   - static files
>   - media files
>   - security
>   - logging
>   - multiple environments (for example, how to use settings for multiple
> environments. environment variables are the way to go IMO)
>   - automatic deployment
>   - backup, restore, clone production to qa (clone to qa is a really useful
> feature if your database is small enough for it)
>
> Second step would be to automate as much of the above list as possible.
> Maybe the mezzanine fab file is enough for that.
>
> The above list also tells a pretty good story about why I pursue a
> documented way to fully set up Django. When setting up a small Django app,
> doing all of the above things properly requires just too much effort.
>
>  - 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.
> 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/c6bd553e-f21e-4a4f-ba5a-150e58bac0db%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/CAEE%2BrGpHh-u3rU8G-dZrYLSFvn1ZNeUkpGfbSftHSfYbdD%3DbrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django on Docker

2015-01-11 Thread Anssi Kääriäinen
I have given this issue a bit more thought, and it seems using Docker might 
be a bit too complex for the "just completed tutorial use case". Docker is 
nice, but if things do not work out the way you want, troubleshooting can 
get a bit complex.

Instead it might be good to *fully* document how to set up a virtual 
machine based Django setup. The documentation should include:
  - minimal information about how to install virtualbox and Ubuntu 14.04 
image. (Maybe vagrant would be a better idea?)
  - how to setup Django with Gunicorn (is supervisord a good idea for 
process management?)
  - static files
  - media files
  - security
  - logging
  - multiple environments (for example, how to use settings for multiple 
environments. environment variables are the way to go IMO)
  - automatic deployment
  - backup, restore, clone production to qa (clone to qa is a really useful 
feature if your database is small enough for it)

Second step would be to automate as much of the above list as possible. 
Maybe the mezzanine fab file is enough for that.

The above list also tells a pretty good story about why I pursue a 
documented way to fully set up Django. When setting up a small Django app, 
doing all of the above things properly requires just too much effort.

 - 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.
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/c6bd553e-f21e-4a4f-ba5a-150e58bac0db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django on Docker

2015-01-09 Thread Anssi Kääriäinen
On Thursday, January 8, 2015 at 1:20:39 PM UTC+2, Mike Dewhirst wrote:

>
> Have you seen Mezzanine fab deployment? Ken Bolton has blogged about it 
> ... 
>
> http://bscientific.org/blog/mezzanine-fabric-git-vagrant-joy/ 
>

Seems interesting. I have to play with it.

The biggest issues for me are that you use settings file directly to have 
your deployment description. Also, at least by default this solution 
doesn't work on Docker (though vagrant does seem to have Docker support, so 
it might be just a configuration issue).

What I did in django-dockerfile, and what I really like about 
django-dockerfile, is that server specific configuration is separated from 
settings.py. There is usually a base, secrets and then deployment 
environment files. The way this works is that base.env could contain the 
following:
{
   "DATABASE_HOST": null,
   "DATABASE_PASSWORD": null,
   "DATABASE_USER": "someuser
}
Here null values denote that these settings must be overridden by other 
environment files.

secrets.env could contain:
{
"DATABASE_PASSWORD": "somepassword"
}

and then production.env has:
{
"from": ["base.env", "secrets.env"],
"DATABASE_HOST": "example.com"
}

Now, when using production.env, first variables from base.env are read, 
then vars from production.env override the DATABASE_PASSWORD variable, and 
finally the production.env overrides the DATABASE_HOST variable.

The project's settings.py uses environment variables always, so that there 
is no need for multiple different settings files.

The point is that it is very easy to have production, qa and other needed 
environments set up. Just create a qa.env and inherit from base.env. The 
code used for different environments is always the same, including the 
settings file which makes it easier to see what is actually going on with 
settings.

 - 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.
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/50c1c885-a554-4635-8623-8fa743f47c62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django on Docker

2015-01-09 Thread Anssi Kääriäinen
On Thursday, January 8, 2015 at 2:28:25 PM UTC+2, Jeroen Bakker wrote:
>
>  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.
>

This solution seems excellent, but it is too heavy for those who just want 
to deploy single small application.

What I am looking after is a solution for guys who have just completed 
Django tutorial and now want to deploy their code. I have a hunch that way 
too often the solution is to use devserver + sqlite.

 - 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.
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/8de1f863-e18d-410d-a53a-69af8b2279fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django on Docker

2015-01-08 Thread Jeroen Bakker

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_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 

Re: Deploying Django on Docker

2015-01-08 Thread Mike Dewhirst

On 8/01/2015 9:45 PM, 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.


Have you seen Mezzanine fab deployment? Ken Bolton has blogged about it ...

http://bscientific.org/blog/mezzanine-fabric-git-vagrant-joy/

Mike




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
.
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/eeb24be3-1f3d-4d4e-8ba0-7a476871c43a%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
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/54AE67E5.3050704%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django on Docker

2015-01-08 Thread Guilherme Leal
Honestly, i dont have the time to participate on this project right now,
but i would use a tool like this for small projects. FOR SURE.

Em Thu Jan 08 2015 at 08:45:56, Anssi Kääriäinen 
escreveu:

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.
> 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/eeb24be3-1f3d-4d4e-8ba0-7a476871c43a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAOs3Lp43K3NoSL7VYN4Y_CcMoDPM3xgn5MHWS5w64XrKESQU5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Deploying Django on Docker

2015-01-08 Thread Anssi Kääriäinen
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.
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/eeb24be3-1f3d-4d4e-8ba0-7a476871c43a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.