How do I deploy my Rails project?
- In the panel, open My servers and click your server.
- On the Overview tab, wait for the App row to say "Ruby on Rails is ready". The page refreshes itself.
- Open the link in the Site address row. The sample page shows the Rails version.
Working on the project
Connect over SSH and switch to the project user:
su - app
cd ~/uygulama
set -a; . /etc/seturack-rails.env; set +a
export PATH=$GEM_HOME/bin:$PATH
After that, bundle install, bin/rails db:migrate and bin/rails assets:precompile work. When your code changes, run systemctl restart uygulama as root.
Good to know
- The database is SQLite and lives in the
storagefolder. If you want PostgreSQL or MariaDB, install it withaptand changeconfig/database.yml. - Puma listens on port 3000 only inside the server.
Your own domain
- Point your domain's A record to your server's IP address.
- As root, replace the old name everywhere:
sed -i 's/OLD_NAME/yourdomain.com/g' /etc/caddy/Caddyfile.OLD_NAMEis the part afterhttps://in the address shown in the panel. - Run
systemctl reload caddy.
Caddy gets and renews the certificate by itself.
Only 80, 443 and 22 for SSH are open to the outside.
No server yet? Order a server with Ruby on Rails installed: you choose the size and pay for what you choose.
Thanks for your feedback!