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
# config/deploy.rb | |
lock '3.11.0' # Edit this to match your capistrano version | |
set :application, 'AppName' | |
set :repo_url, '[email protected]:GitHubUserName/AppName.git' # Edit this to match your repository | |
set :branch, :master | |
set :deploy_to, '/home/deploy/apps/AppName' | |
set :linked_files, %w{config/database.yml config/application.yml config/secrets.yml} | |
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads} | |
set :bundle_binstubs, nil |
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
# config/nginx.conf | |
upstream puma { | |
server unix:///home/deploy/apps/AppName/shared/tmp/sockets/puma.sock; | |
} | |
server { | |
listen 80 default_server deferred; | |
server_name DomainName; | |
# if you only use a static ip address | |
# listen 80; | |
# server_name <STATIC IP ADDRESS>; |
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
# config/database.yml | |
default: &default | |
adapter: postgresql | |
encoding: unicode | |
pool: <%= ENV.fetch('RAILS_MAX_THREADS') { 5 } %> | |
development: | |
<<: *default | |
database: AppName_development | |
test: | |
<<: *default |
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
# config/application.yml | |
development: | |
secret_key_base: something_secret | |
test: | |
secret_key_base: something_else_secret | |
production: | |
SECRET_KEY_BASE: something_else_secret_generate_from_rails_secret | |
PG_DBNAME: ProductionDBName | |
PG_USERNAME: deploy | |
PG_PASSWORD: YourPostgresPassword |
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
... | |
group :development do | |
gem 'capistrano', require: false | |
gem 'capistrano-rbenv', require: false | |
gem 'capistrano-rails', require: false | |
gem 'capistrano-bundler', require: false | |
gem 'capistrano3-puma', require: false | |
gem 'capistrano-sidekiq', require: false | |
end | |
gem ‘puma’ |
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
# Capfile | |
# Load DSL and Setup Up Stages | |
require 'capistrano/setup' | |
require 'capistrano/deploy' | |
require "capistrano/scm/git" | |
install_plugin Capistrano::SCM::Git | |
require 'capistrano/rails' | |
require 'capistrano/bundler' | |
require 'capistrano/rbenv' |
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
# /etc/letsencrypt/options-ssl-nginx.conf | |
ssl_session_timeout 5m; | |
ssl_session_cache shared:SSL:50m; | |
ssl_session_timeout 1440m; | |
ssl_session_cache shared:ssl_session_cache:10m; | |
ssl_session_tickets off; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; |
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
# config/nginx.conf | |
upstream puma { | |
server unix:///home/deploy/apps/AppName/shared/tmp/sockets/puma.sock; | |
} | |
server { | |
server_name example.com www.example.com.tw; | |
root /home/deploy/apps/AppName/current/public; | |
access_log /home/deploy/apps/AppName/current/log/nginx.access.log; | |
error_log /home/deploy/apps/AppName/current/log/nginx.error.log info; |
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
<!-- Include Quill stylesheet --> | |
<link href="https://cdn.quilljs.com/1.3.5/quill.snow.css" rel="stylesheet"> | |
<div id="form-container"> | |
<%= form_for @portfolio do |f| %> | |
<div class="form-group"> | |
<%= f.label :title %> | |
<%= f.text_field :title, class: "form-control" %> | |
</div> | |
<div class="form-group"> |
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=deploy | |
WorkingDirectory=/home/deploy/apps/shiftweb/current | |
Environment=RAILS_ENV=production | |
ExecStart=/home/deploy/.rvm/bin/rvm ruby-2.6.5 do bundle exec puma -C /home/deploy/apps/shiftweb/shared/puma.rb |
OlderNewer