According to recent reports, originally published on gregale.dev. I build Gregale, so read this as a vendor's page. Competitor details come from each vendor's own docs, linked in the post. This post was written with AI assistance.
Sources indicate that A Rails 8 app generated with rails new --database=postgresql deploys on Gregale from its own Dockerfile with a few changes: upload the vendor/ folder, start Puma directly, run db:migrate from a release script that switches to the migration credential, and drop Active Storage so the image fits. Rails used 257 MB of memory in our test, so it needs the Hobby strategy's 512 MB; the Free plan's 256 MB is just too small, and Free has no managed PostgreSQL anyway. The working result is public at gregale-dev/rails-postgres.
Rails still writes its production Dockerfile, and Gregale builds from it.
1. Upload vendor/. Gregale leaves vendor folders out of every upload by default, but the Rails Dockerfile runs COPY vendor/* ./vendor/, and the build fails with lstat /vendor: no such file or directory. Add a .gregaleignore at the project root:.
According to recent reports, 2. Start Puma directly. The Dockerfile's default command starts Thruster, a proxy in front of Puma. Gregale already terminates HTTPS and proxies requests to the app, so run Puma on its own, and point the health check at Rails' built-in /up:.
Puma listens on the port in PORT, which Gregale sets. access: public lets visitors in without a Gregale API key. The release command runs before a new version takes traffic. If it fails, the previous version keeps serving.
Industry observers note that 3. Migrate with the migration credential. Gregale gives a database two kinds of credentials. DATABASE_URL reads and writes rows but cannot CREATE, ALTER or DROP anything, and serving instances get only that one. MIGRATION_DATABASE_URL can change the schema, and only the release command receives it, alongside DATABASE_URL.
It has been revealed that rails gives the DATABASE_URL environment variable precedence over the url in config/database.yml, so release: ./bin/rails db:migrate migrates with the serving credential, even with MIGRATION_DATABASE_URL named in database.yml. The release then fails with PG::InsufficientPrivilege: permission denied for schema public. Point DATABASE_URL at the migration credential before Rails starts, in bin/release:.
Make it executable with chmod +x bin/release. So db:migrate runs with schema rights, and the running app never has them.
In a recent development, 4. Keep migrations out of the entrypoint. Rails' default bin/docker-entrypoint runs ./bin/rails db:prepare before the server starts, which would migrate with the serving credential. Replace it with one that only starts the command:.
Recent findings suggest that 5. Read one database URL in production. Replace the production: block in config/database.yml:.
It has been revealed that the serving DATABASE_URL goes through a connection pooler in transaction mode, which cannot keep prepared statements or session-level advisory locks between transactions. The migration credential connects to PostgreSQL directly, so the release keeps the advisory lock Rails holds while it migrates.
Recent findings suggest that 6. Drop Active Storage and libvips. Gregale caps the layer an image adds on top of its runtime base at 512 MB on Hobby. Rails' default image installs libvips for Active Storage image variants, and in our test it came to 517 MB. Remove libvips from the apt-get install line in the Dockerfile, the image_processing gem from the Gemfile, and Active Storage itself: comment out require "active_storage/engine" in config/application.rb (or replace require "rails/all" with the frameworks you use), and delete config/storage.yml and the config.active_storage lines in config/environments/. That brought the image to 419 MB. Store uploads in object storage instead; Active Storage's disk service would lose them anyway (see below).
It has been revealed that gregale add postgres creates the database blog-postgres and attaches it as DATABASE_URL. The attach adds the migration credential. Rails reads its credentials with RAILS_MASTER_KEY, which the Dockerfile build leaves out on purpose, so pass it to the deploy as a secret. Keep the secrets file out of the repository.
The example repo declares both credentials in its gregale.yaml instead, so its first deploy creates the database, and reads SECRET_KEY_BASE from the environment, so a fresh clone needs no master.key.
We deployed the example repo, a Rails 8.1.4.1 notes app on Ruby 4.0.10, on Gregale on 2026-11-29:.
According to recent reports, render's Free PostgreSQL databases expire 30 days after creation. A Gregale database on Hobby has no expiry and includes a 7-day restore window.
Sources, checked 2026-11-27: Heroku release phase, Render: deploy Rails 8, Render free instances, Fly.io app configuration.
According to recent reports, hobby costs $10 a month and includes one managed PostgreSQL database, 512 MB per app and 200 GB-RAM-hours. Between requests the app pauses, and paused seconds are not billed. See Gregale pricing, Managed PostgreSQL and Container compatibility.
