Created
January 21, 2015 06:51
-
-
Save dtan4/373907a001f3f3ebbd9c to your computer and use it in GitHub Desktop.
Minimal Sinatra Application on Docker
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
class App < Sinatra::Base | |
get "/" do | |
"hello" | |
end | |
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
require "bundler" | |
Bundler.require | |
require "./app.rb" | |
run App |
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
FROM ruby:2.2.0 | |
RUN bundle config --global frozen 1 | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
ADD Gemfile /usr/src/app/ | |
ADD Gemfile.lock /usr/src/app/ | |
RUN bundle install --without test development --system | |
ADD . /usr/src/app | |
RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
EXPOSE 9292 | |
CMD ["bundle", "exec", "rackup", "-p", "9292", "-E", "production"] |
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
source "https://rubygems.org" | |
gem "sinatra", "~> 1.4.5" |
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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
rack (1.6.0) | |
rack-protection (1.5.3) | |
rack | |
sinatra (1.4.5) | |
rack (~> 1.4) | |
rack-protection (~> 1.4) | |
tilt (~> 1.3, >= 1.3.4) | |
tilt (1.4.1) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
sinatra (~> 1.4.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment