Documentation menu

Deploy Sinatra on Light Cloud - a Ruby container on port 3000, served by Puma bound to the routed port.

Deploy Sinatra

Sinatra is detected from your Gemfile and runs as a Ruby container on port 3000. No Dockerfile needed - one is generated unless the repo has its own.

Serve it#

Run a real server (Puma via config.ru is the standard), bound to all interfaces on the routed port:

bundle exec puma -b tcp://0.0.0.0:$PORT

Or inside a classic-style app:

set :bind, '0.0.0.0'
set :port, ENV.fetch('PORT', 3000)

Configuration and database#

Read environment variables with ENV at startup. DATABASE_URL from the Credentials tab plugs into Sequel or ActiveRecord directly.

Scaling#

Sinatra apps are small and boot fast - a good fit for scale to zero. Sync Ruby workers hold a request each, so keep concurrency near your Puma thread count rather than the default 80.