Last active
August 29, 2015 14:06
-
-
Save Gurpartap/ef78033f059cf593e4f0 to your computer and use it in GitHub Desktop.
Ruby Sinatra docker app for (not just) Kitematic
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' | |
class HelloWorldApp < Sinatra::Base | |
get '/' do | |
"Hello, world!" | |
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 './app' | |
run HelloWorldApp |
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 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 |
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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
great !
thanks :)