-
Notifications
You must be signed in to change notification settings - Fork 69
Configuration
Most of the configuration for deploying your Rails application will go into config/moonshine.yml
.
Any of the options shown below could also be configured using the configure
method in your manifest. If the configuration is static, it is easier to read them in moonshine.yml
. The example below configures the Passenger max pool size differently depending on the stage you are deploying to. This assumes you are using the capistrano-ext gem for multistage deployment.
configure( :passenger => {:max_pool_size => deploy_stage == 'production' ? 12 : 2 })
Options are ree
and mri
:ruby: ree
:application: your_app_name :user: rails :deploy_to: /srv/your_app_name :repository: git@github.com:username/your_app_name.git
:domain: yourapp.com :domain_aliases: - assets1.yourapp.com - assets2.yourapp.com
This allows anyone from the 192.168.1 subnet or users who can log in. Also useful are the :deny and :satisfy directives. More info from the Apache docs.
:apache: :users: :admin: sekrit :allow: 192.168.1
Timezone to use on the server. This can be set to any of the files in /usr/share/zoneinfo/
on your Ubuntu server. UTC is the default. Other options include GMT
, America/New_York
, and Navajo
.
:time_zone: UTC
Note that Rails’ time zone support expects your database, or your server, to be configured for UTC. MySQL will use the system time zone by default, so you should leave this as the default unless you have a compelling reason to change it (e.g. you haven’t integrated time zone support in your app). Alternatively, you can explicitly configure MySQL if you wish to have it set differently from the server for some reason:
:mysql: :default_time_zone: foo
Use :app_symlinks to setup directories under public/
that you want to persist across deployments. They’ll be symlinked to the shared directory.
:app_symlinks: - uploads
Use :local_config to copy directories straight from your local project directory to the server: these are files that you don’t have/want in scm.
:local_config: - config/database.yml
These should probably be left as is unless you need to add more for some reason.
:shared_children: - system - log - pids - config
Moonshine now includes gemcutter.org
as a gem source by default, and gives it priority over rubyforge. The defaults are illustrated here — you can change or reorder them to your liking:
:rubygems: :sources: - http://gemcutter.org - http://gems.rubyforge.org - http://gems.github.com
After specifying a gem with config.gem, run ‘rake moonshine:gems’ to update config/gems.yml. If the gem depends on native packages, tell Moonshine here. Moonshine automatically knows about dependencies for some common gems: curb,mysql,sqlite3-ruby,nokogiri,rmagick,paperclip,thoughtbot-paperclip,mini_magick,postgres
:apt_gems: :awesomegem: - awesome - libawesome-dev
To see all the options for these services, look at the variables in their respective ERB templates under moonshine/lib/moonshine/manifest/rails/templates
:passenger: :version: 3.0.4 # Force passenger to remain at this version :max_pool_size: 3 # Use a maximum of 3 passenger workers :use_global_queue: true # Use the global request queue
To see all the options for these services, look at the variables in their respective ERB templates under moonshine/lib/moonshine/manifest/rails/templates
:mysql: :innodb_buffer_pool_size: 128M