There are a few additional steps I noticed to setting up a Sinatra app to work on Dokku. (These are probably also required for deploying an app to Heroku.)
original app.rb
require 'sinatra'
get '/' do
"Your Sinatra app is not quite Dokku-fied!"
end
1. Add a Gemfile
Dokku/Docker complains if you do not specify an https source and a ruby version.
source "https://rubygems.org"
gem 'sinatra'
gem 'thin'
ruby '2.0.0'
2. run bundle install to generate Gemfile.lock
bundle install
3. Add a Rack configuration file: config.ru
require './app'
run Sinatra::Application
4. (optional) add a Procfile to tell dokku to use Thin instead of Webrick Procfile
web: bundle exec thin start -p $PORT -e $RACK_ENV
5. Move inline templates to views/ view/welcome.erb
<h2>Welcome to Dokku</h2>
Your Sinatra app is Dokku-fied!
and update app.rb
to call new template
require 'sinatra'
get '/' do
erb :index
end
6. add these to the git repo and push
git push dokku master
Awesome!