Skip to content

Instantly share code, notes, and snippets.

@miyohide
Created May 7, 2022 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miyohide/bf1b26f975a3e34c5d8d87dc799fb1eb to your computer and use it in GitHub Desktop.
Save miyohide/bf1b26f975a3e34c5d8d87dc799fb1eb to your computer and use it in GitHub Desktop.
Cloud Native Buildpacks for Ruby
require "sinatra"
set :bind, "0.0.0.0"
set :port, 8080
get "/" do
"Hello My Sinatra App"
end
# build
$ sudo pack build sample-app-ruby2 --path . --builder heroku/buildpacks:20
# run
$ sudo docker run --rm -p 8080:8080 sample-app-ruby2
# frozen_string_literal: true
source "https://rubygems.org"
ruby "3.1.2"
gem "sinatra"
gem "puma"
web: bundle exec ruby app.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment