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
# frozen_string_literal: true | |
require 'capistrano/setup' | |
require 'capistrano/deploy' | |
require 'capistrano/scm/git' | |
require 'capistrano/rvm' | |
require 'capistrano/bundler' | |
install_plugin Capistrano::SCM::Git | |
require 'capistrano/rails/console' |
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
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
[Service] | |
Type=simple | |
User=myuser | |
WorkingDirectory=/path/to/my/rails-app | |
Environment=RAILS_ENV=production |
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
# Place in /config/puma/production.rb | |
rails_env = "production" | |
environment rails_env | |
app_dir = "/path/to/my/rails-app" # Update me with your root rails app path | |
bind "unix://#{app_dir}/puma.sock" | |
pidfile "#{app_dir}/puma.pid" | |
state_path "#{app_dir}/puma.state" |
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
upstream app { | |
server unix:///path/to/rails/puma.sock fail_timeout=0; | |
} | |
server { | |
server_name 1.2.3.4 www.myrailsapp.com; | |
root /path/to/rails/public; | |
location ^~ /assets/ { | |
gzip_static on; |
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
[Unit] | |
Description=sidekiq | |
After=syslog.target network.target | |
[Service] | |
Type=simple | |
User=ubuntu | |
Group=ubuntu | |
UMask=0002 | |
WorkingDirectory=/path/to/rails |
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
upstream rails { | |
server unix:///home/ec2-user/production/railsapp/current/puma.sock fail_timeout=0; | |
} | |
server { | |
server_name _; | |
root /home/ec2-user/production/railsapp/current/public; | |
location / { |
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
[Unit] | |
Description=Puma | |
After=network.target | |
[Service] | |
Type=forking | |
User=ec2-user | |
Environment=RAILS_ENV=production | |
WorkingDirectory=/home/ec2-user/production/railapp/current |
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
rails_env = "production" | |
environment rails_env | |
app_dir = File.expand_path("../../..", __FILE__) | |
bind "unix://#{app_dir}/puma.sock" | |
pidfile "#{app_dir}/puma.pid" | |
state_path "#{app_dir}/puma.state" | |
directory "#{app_dir}" |
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
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rvm' | |
set :application_name, 'railsapp' | |
set :domain, '255.255.255.255' | |
set :deploy_to, '/home/ec2-user/production/railsapp' | |
set :repository, '[email protected]:company/railsapp.git' | |
set :branch, 'main' | |
set :user, 'ec2-user' |
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
[Unit] | |
Description=sidekiq | |
After=syslog.target network.target | |
[Service] | |
Type=simple | |
User=ec2-user | |
Group=ec2-user | |
UMask=0002 | |
WorkingDirectory=/home/ec2-user/production/railsapp/current |