Menu

How to deploy a Ruby on Rails app on Ownkube
📰

How to deploy a Ruby on Rails app on Ownkube

DEV Community: ruby·Abhishek Jaiswal·14 days ago
#hHKXJQd0
#devtoruby#devto#dev#rails#ownkube
Reading 0:00
15s threshold

A Rails app needs three things from a host: a place to run Puma , a Postgres database it can reach, and a way to run db:migrate before traffic hits the new code. Ownkube covers all three without a cloud account or hand-written YAML.

This walks through deploying a standard Rails app on Ownkube Compute: configuring Puma, wiring up a managed Postgres , setting RAILS_MASTER_KEY and SECRET_KEY_BASE , precompiling assets, and running migrations as a job.

TL;DR

Push a Rails app with a Dockerfile , and Ownkube builds and deploys it behind automatic TLS.

Add an Ownkube-managed Postgres database and set DATABASE_URL from its connection string.

Set RAILS_MASTER_KEY (or SECRET_KEY_BASE ) and RAILS_ENV=production as environment variables in the dashboard, not in the repo.

Precompile assets in the Docker build step, and run db:migrate as a one-off job, so it runs once per release instead of on every container start.

Metered billing fits Rails well: Puma sits mostly idle between requests, so the CPU line barely…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.