Skip to content

Commit 1871394

Browse files
committed
Add unicorn app
1 parent b5aebe3 commit 1871394

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

ruby/unicorn/Gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
ruby '~> 2.0'
4+
5+
gem 'unicorn'
6+
gem 'sinatra'

ruby/unicorn/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Ruby sample app using Unicorn web server
2+
3+
## Building
4+
5+
`pack build unicorn-sample --buildpack gcr.io/paketo-community/ruby`
6+
7+
## Running
8+
9+
`docker run --interactive --tty --env PORT=8080 --publish 8080:8080 unicorn-sample`
10+
11+
## Viewing
12+
13+
`curl http://localhost:8080`

ruby/unicorn/app.rb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'sinatra'
2+
3+
get '/' do
4+
'<!DOCTYPE html>
5+
<html>
6+
<head>
7+
<title>Powered By Paketo Buildpacks</title>
8+
</head>
9+
<body>
10+
<img style="display: block; margin-left: auto; margin-right: auto; width: 50%;" src="https://paketo.io/images/paketo-logo-full-color.png"></img>
11+
</body>
12+
</html>'
13+
end

ruby/unicorn/config.ru

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require './app'
2+
run Sinatra::Application

0 commit comments

Comments
 (0)