Created
May 7, 2022 07:53
-
-
Save miyohide/bf1b26f975a3e34c5d8d87dc799fb1eb to your computer and use it in GitHub Desktop.
Cloud Native Buildpacks for Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sinatra" | |
set :bind, "0.0.0.0" | |
set :port, 8080 | |
get "/" do | |
"Hello My Sinatra App" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build | |
$ sudo pack build sample-app-ruby2 --path . --builder heroku/buildpacks:20 | |
# run | |
$ sudo docker run --rm -p 8080:8080 sample-app-ruby2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
source "https://rubygems.org" | |
ruby "3.1.2" | |
gem "sinatra" | |
gem "puma" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bundle exec ruby app.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment