Skip to content

Instantly share code, notes, and snippets.

@fabdelgado
Forked from dtan4/Dockerfile
Created January 24, 2019 20:58
Show Gist options
  • Save fabdelgado/9dba030940ee37a9483164e9958dd5db to your computer and use it in GitHub Desktop.
Save fabdelgado/9dba030940ee37a9483164e9958dd5db to your computer and use it in GitHub Desktop.
Minimal Sinatra Application on Docker
class App < Sinatra::Base
get "/" do
"hello"
end
end
require "bundler"
Bundler.require
require "./app.rb"
run App
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"]
source "https://rubygems.org"
gem "sinatra", "~> 1.4.5"
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