Exporting for production

Marshall Anschutz edited this page May 22, 2014 · 1 revision

If you want to use a configuration in production that is similar to your Foreman setup, then you can export into the init system of your choice by running a command similar to foreman export upstart /etc/init. For more options, see the man page.

Production Environment

If you are exporting in a newer version of foreman (after 0.63), then foreman will not include your current environment in the upstart scripts. Instead, you should provide a .env file as part of the export process. This improves security as passwords and such are no longer easy to expose in the process list on the server.

The .env file will most likely need to include a PATH, as well as any other environmental settings your application needs.

For a Ruby on Rails application, here is a common starting point that includes rvm.

PATH=/home/user/.rvm/gems/ruby-2.1.1/bin:/home/user/.rvm/rubies/ruby-2.1.1/bin:/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/user/.rvm/bin
RAILS_ENV=production