Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ThisIsAreku
Copy link
Contributor

This PR add docker-compose support. It allows you to deploy a full production-ready environment.

  • It start gunicorn with a number of thread depending on the number of cpu.
  • Nginx is used as a front proxy.
  • Postgres and Redis data are stored in docker data volumes.
  • /assets/ and /media/ directories are not forwarded to python and are processed directly by nginx

I took the liberty to update gunicorn version in the requirements.

@nimaje
Copy link
Contributor

nimaje commented May 5, 2016

This nginx config file doesn't look specific for docker.
Why is it in this subdir and why is it named pokeapi.conf?
These numbers in gunicorn.py.ini seem a little bit random.
And @phalt why is wsgiref==0.1.2 a dependency wsgiref is since py2.5 in the standardlib and the pypi version seems not to be python3 compatible.

@ThisIsAreku
Copy link
Contributor Author

ThisIsAreku commented May 5, 2016

pokeapi.conf is added to the nginx container on docker build. The configuration is adapted to proxy the requests to the app container, I don't understand how it should be more specific to docker.

And the gunicorn configuration is from the docs: http://docs.gunicorn.org/en/latest/configure.html#configuration-file

@nimaje
Copy link
Contributor

nimaje commented May 5, 2016

The question was why it is in this subdir (docker/) though not be docker specific.
It could be somewhere else named nginx.conf and everyone should see that this is a nginx config file not specific to docker.
After the docs max_requests is to limit the damage of memory leaks (should be not needed if there are no memory leaks) and not set in the config you linked.

@ThisIsAreku
Copy link
Contributor Author

True, I'll move it elsewhere. But as app is hardcoded in the config file, I don't think you can use it easily in a classic nginx installation (ie. you'll have to edit the hosts file to point app to localhost)

@phalt
Copy link
Member

phalt commented May 6, 2016

@nimaje on the wsgiref - I've not updated the dependencies in a while. These are the pip freeze results from way back when I was building it.

@phalt
Copy link
Member

phalt commented May 6, 2016

@ThisIsAreku looks super good. What's the purpose of this vs the development version that we have in docker?

@ThisIsAreku
Copy link
Contributor Author

This version is more oriented to production system, with a proper isolation between services. Also, (IMO) it's easier to manage an application with docker-compose, you don't have to configure manually your server.

@phalt
Copy link
Member

phalt commented Jul 7, 2016

Okay, I really wanna merge this! 👍 Let's get another person to check it off first

@sargunv
Copy link
Member

sargunv commented Jul 7, 2016

👍

@phalt phalt merged commit d771c29 into PokeAPI:master Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants