This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.
This is how I manage real production loads for my Rails apps. It assumes:
- Rails 7+
- Ruby 3+
- PostgreSQL
- Ubuntu Server 24.04
- Capistrano, Puma, Nginx
This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.
This is how I manage real production loads for my Rails apps. It assumes:
fr: | |
admin: | |
js: | |
true: Vrai | |
false: Faux | |
is_present: Est présent | |
is_blank: Est vide | |
date: Date ... | |
between_and_: Entre le ... et le ... | |
today: "Aujourd'hui" |
Follow this guide until it gets to the upstart
parts and then
follow the steps below (https://github.com/puma/puma/blob/master/docs/systemd.md):
Add to Gemfile:
group :development do
gem 'capistrano', '~> 3.6'
gem 'capistrano-rails', '~> 1.1'
Example inputs:
Variable | Value |
---|---|
key | the shared secret key here |
message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
#!/bin/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
# Capistrano Task that hooks into `deploy:finished` to send a message to Slack | |
# | |
# 1. Setup a Slack Incoming Webhook Integration (https://api.slack.com/incoming-webhooks) | |
# 2. Put the Webhook URL in an Environment variable (SLACK_WEBHOOK_URL) | |
# 3. Place this file in `lib/capistrano/tasks` | |
# | |
# This will then create a new message in the channel on deployment, including who, what and where information | |
require "net/http" | |
require "json" |