Skip to content

Instantly share code, notes, and snippets.

@knice
Created January 22, 2016 04:23
Show Gist options
  • Select an option

  • Save knice/ff821701093f0f91cb9b to your computer and use it in GitHub Desktop.

Select an option

Save knice/ff821701093f0f91cb9b to your computer and use it in GitHub Desktop.
Sinatra (modular) & Docker
require "sinatra/base"

class App < Sinatra::Base
  set :bind, "0.0.0.0"
    
  get "/status" do
    "ok"
  end
end
require "./app"

run App.new 
FROM ruby:2.1.2
MAINTAINER Charlie Revett <[email protected]>

RUN mkdir /app
ADD . /app

WORKDIR /app

RUN bundle install

EXPOSE 9292

CMD ["rackup", "config.ru", "-p", "9292", "-o", "0.0.0.0"]
docker build -t sinatra-docker-example .
docker run -it -p 9292:9292 sinatra-docker-example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment