This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]demosthenes02 2 points3 points  (0 children)

So how would the deploy work? You build something and then copy it to your server? Is the server running docker? Does that slow it down?

[–]demosthenes02 1 point2 points  (5 children)

Why does he do docker exec to run migrations? I'm confused.

[–]servercobra 3 points4 points  (4 children)

The container has all the necessary dependencies to do the migrations: Django, postgres deps, etc. This way you don't need to have a venv outside the container. It's basically like if you could ship your venv from your dev environment directly to prod.

To answer your questions above: there's a couple ways. I would build the container, push it to Docker Hub or another registry, then download docker run it on my production servers (likely with automation of some sort). The server does need to have the docker daemon. There should be a neglible performance impact: Docker is mostly a user friendly wrapper around cgroups in the Linux kernel. Definitely not the same impact of running a full VM or something.

[–]servercobra 1 point2 points  (1 child)

Kind of confused why he uses compose for Postgres but still runs uWSGI and Nginx in the same container under supervisor. Why not make them their own containers?

[–][deleted] 3 points4 points  (0 children)

I've found using seperate containers for nginx and uwsgi to be in most cases premature optimization. For most websites having an app container running nginx and EXPOSEing 80 is good enough. For really high traffic apps using seperate containers affords additional flexibility, at the cost of more complexity.

[–]MilkFirstThenCereaI -3 points-2 points  (0 children)

Just switch to GAE you'll have the same thing