Base Sinatra installation with Hello World web app.
976
Based on dylan's info at his Sinatra-Gist
Dockerfile:
FROM ubuntu
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y ruby git
RUN gem install bundler
ADD . /sinatra
WORKDIR /sinatra
RUN bundle install
EXPOSE 5000
CMD ["/usr/local/bin/foreman","start","-d","/sinatra"]
# docker run --rm -i -t -p 5000:5000 sinatra
Gemfile:
source 'https://rubygems.org'
gem 'sinatra'
gem 'foreman'
Procfile:
web: bundle exec ruby server.rb
server.rb:
require 'sinatra'
#Bound to this address so that external hosts can access it, VERY IMPORTANT!
set :bind, '0.0.0.0'
set :logging, true
get '/' do
'hello world'
end
Content type
Image
Digest
sha256:daa27a86f…
Size
122.6 MB
Last updated
almost 11 years ago
docker pull uhoffmann/sinatra