Skip to content

Piousbox-cookbooks/upstream-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Upstream apps

  • Creates capistrano directory structure for an app
  • Creates an nginx vhost configured as an upstream server
  • If a rack app is detected, creates a unicorn config and upstart script to run the app.

Usage

Create an apps data bag

Create a data bag item for each app:

{
  "id": "app1",
  "unicorn_port": "8001",

  "server_roles" : [ "appserver" ],

  "production": {
    "domains": [
      "example.com",
      "origin.example.com"
    ]
  },

  "staging": {
    "domains": [
      "origin-staging.example.com",
      "staging.example.com"
    ]
  },

  "dev": {
    "domains": [
      "origin-dev.example.com",
      "dev.example.com"
    ]
  }
}

Domains

production, staging, and dev correspond to chef environents. So if the recipe is running on a node who's environment is staging, the recipe will insert those domains into the nginx vhost.

Server Roles

Also, the app will only be installed on nodes that have a role listed in the server_roles array. If server_roles is missing, the app will be installed by default.

About

Cookbook to set up unicorn/nginx upstream shared hosting for apps

Resources

Stars

Watchers

Forks

Packages

No packages published