Skip to content

Instantly share code, notes, and snippets.

@Gurpartap
Last active August 29, 2015 14:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gurpartap/ef78033f059cf593e4f0 to your computer and use it in GitHub Desktop.
Save Gurpartap/ef78033f059cf593e4f0 to your computer and use it in GitHub Desktop.
Ruby Sinatra docker app for (not just) Kitematic
require 'sinatra'
class HelloWorldApp < Sinatra::Base
get '/' do
"Hello, world!"
end
end
require './app'
run HelloWorldApp
FROM ubuntu:14.04
RUN apt-get update -qq && \
apt-get install -y make curl -qq && \
apt-get clean && \
curl -sSL "https://github.com/postmodern/ruby-install/archive/master.tar.gz" -o /tmp/ruby-install-master.tar.gz && \
cd /tmp && tar -zxvf ruby-install-master.tar.gz && \
cd /tmp/ruby-install-master && make install && \
apt-get update && \
echo "gem: --no-rdoc --no-ri" >> ~/.gemrc && \
ruby-install -i /usr/local/ ruby -- --disable-install-rdoc --disable-install-ri && \
gem update --system && \
gem install bundler
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
RUN bundle install --path .bundle
ADD . /app
EXPOSE 3000
CMD bundle exec rackup -p 3000
# for rails use:
# CMD bundle exec rails server -p 3000
source 'https://rubygems.org'
gem 'sinatra'
@brownman
Copy link

brownman commented Dec 7, 2014

great !
thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment