Permalink
Browse files

Add a complete example of a python application.

  • Loading branch information...
1 parent 8d54b41 commit fb93ae5d65cb2b90b3f5e793c6f6de191c5454d1 @andreacampi andreacampi committed Apr 6, 2012
Showing with 48 additions and 0 deletions.
  1. +48 −0 examples/recipes-packaginator.rb
@@ -0,0 +1,48 @@
+application "packaginator" do
+ path "/srv/packaginator"
+ owner "nobody"
+ group "nogroup"
+ repository "https://github.com/coderanger/packaginator.git"
+ revision "master"
+ migrate true
+ packages ["libpq-dev", "git-core", "mercurial"]
+
+ django do
+ packages ["redis"]
+ requirements "requirements/mkii.txt"
+ settings_template "settings.py.erb"
+ debug true
+ collectstatic "build_static --noinput"
+ database do
+ database "packaginator"
+ engine "postgresql_psycopg2"
+ username "packaginator"
+ password "awesome_password"
+ end
+ database_master_role "packaginator_database_master"
+ end
+
+ gunicorn do
+ only_if { node['roles'].include? 'packaginator_application_server' }
+ app_module :django
+ port 8080
+ end
+
+ celery do
+ only_if { node['roles'].include? 'packaginator_application_server' }
+ config "celery_settings.py"
+ django true
+ celerybeat true
+ celerycam true
+ broker do
+ transport "redis"
+ end
+ end
+
+ nginx_load_balancer do
+ only_if { node['roles'].include? 'packaginator_load_balancer' }
+ application_port 8080
+ static_files "/site_media" => "site_media"
+ end
+
+end

0 comments on commit fb93ae5

Please sign in to comment.