- login to 'AWS Management Console' (https://aws.amazon.com/console/)
- from 'Services'(in navbar) choose 'EC2'
- from 'Create Instance' section, click on 'Launch Instance'
- then select 'AMI' (Amazon Machine Image), we will be using 'Ubuntu Server 16.04 LTS (HVM)' as example
- select 'Instance Type' as per your requirement
- then click 'Next:Configure Instance Details' to continue
change 'Configure Instance Details' or used as default settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POSTGRES_DB=myapp_production | |
POSTGRES_USER=postgres | |
POSTGRES_PASSWORD=password | |
POSTGRES_HOST=db | |
RAILS_ENV=production | |
RAILS_MASTER_KEY=your_master_key_here |
Коротке пояснення:
Посередник (Mediator, Intermediary, Controller) — це поведінковий патерн проектування, що дає змогу зменшити зв’язаність великої кількості класів між собою, завдяки переміщенню цих зв’язків до одного класу-посередника.
Плюси та мінуси:
Плюси:
Коротке пояснення:
Ланцюжок обов’язків (CoR, Chain of Command, Chain of Responsibility) — це поведінковий патерн проектування, що дає змогу передавати запити послідовно ланцюжком обробників. Кожен наступний обробник вирішує, чи може він обробити запит сам і чи варто передавати запит далі ланцюжком.
Плюси та мінуси:
- Add
gem 'rails_12factor'
to your Gemfile. This will add error logging and the ability for your app to serve static assets. bundle
- Run
RAILS_ENV=production rake db:create db:migrate db:seed
- Run
rake secret
and copy the output - From the command line:
export SECRET_KEY_BASE=output-of-rake-secret
- To precompile your assets, run
rake assets:precompile
. This will create a folderpublic/assets
that contains all of your assets. - Run
RAILS_ENV=production rails s
and you should see your app.
Remember to clobber your assets (rake assets:clobber
) and re-precompile (rake assets:precompile
) if you make changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<APP>> change this variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root# apt-get update | |
root# adduser deployer | |
root# visudo | |
# add line | |
deployer ALL=(ALL:ALL) ALL | |
root# exit | |
ssh deployer@server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh root@new_server_ip | |
apt-get -y update | |
apt-get -y install curl git-core python-software-properties | |
wget http://nginx.org/keys/nginx_signing.key | |
apt-key add nginx_signing.key |