Specify environment in rails 3 applications with thin

I use thin to run rails application on ec2. How can I indicate that my ec2 instance is a test or prod in thin? Is thin really a good choice to run a rails application in production? At least at first it will not be an application with a large volume.

+4
source share
2 answers

You can transfer the desired environment to thin using -e production on the command line or environment: production in the YAML configuration file.

+8
source

Usually, either Apache or Nginx is used for your web server, which balances requests among many application servers, usually mongrell, thin or unicorn. This can happen in one instance of EC2.

Assuming you know that using the RAILS_ENV environment variable to set the production environment is what you are looking for. You can export it to a bash profile for the entire server if you want, or simply specify it every time you load a thin instance.

I also suggest you take a look at Engine Yard . They provided a fully optimized and configured rack stack on top of ec2 instances for a very small ($ 0.01, maybe?) Higher cost per hour.

0
source

Source: https://habr.com/ru/post/1345334/


All Articles