You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE USER app_name WITH CREATEDB PASSWORD 'app_password';
CREATE DATABASE app_name_production OWNER app_name;
sudo nano /etc/postgresql/9.5/main/pg_hba.conf
# replace 'peer' with 'md5' in local
------------------------------------------------------------------
# Database administrative login by Unix domain socketlocal all postgres peer
# TYPE DATABASE USER ADDRESS METHOD# "local" is for Unix domain socket connections onlylocal all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
------------------------------------------------------------------
sudo /etc/init.d/postgresql restart
Nginx
cd /etc/nginx/sites-enabled
sudo rm -rf default
sudo nano app_name
https://gist.github.com/dayvough/b6e75be8603f71a7cfe54453be71b202
# [Local] app-name/config/deploy.rb
# Lock at current Capistrano version
lock '3.5.0'
set :stages, %w(production staging)
set :default_stage, "staging"
set :application, 'app_name'
set :repo_url, 'git@github.com:user/app-name.git'
set :branch, "master"
set :user, "deploy"
set :ssh_options, { forward_agent: true }
set :deploy_to, "/home/deploy/#{fetch(:application)}"
set :unicorn_config_path, File.join(fetch(:deploy_to), "current", "config", "unicorn.rb")
set :unicorn_pid, File.join(fetch(:deploy_to), "shared", "pids", "unicorn.pid")
set :pty, true
set :keep_releases, 5
set :linked_files, %w{config/database.yml config/secrets.yml}
set :linked_dirs, %w{bin log tmp pids vendor/bundle public/system}
after 'deploy:publishing', 'deploy:restart'
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Execute restarting
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
task :restart do
invoke 'unicorn:legacy_restart'
end
end