Skip to content

Instantly share code, notes, and snippets.

View treeder's full-sized avatar
🥌

Travis Reeder treeder

🥌
View GitHub Profile
FROM iron/ruby
WORKDIR /app
ADD . /app
ENTRYPOINT ["ruby", "app.rb"]
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
docker push treeder/hello-sinatra
docker run --rm -it -p 8080:8080 treeder/hello-sinatra
docker build -t treeder/hello-sinatra:latest .
docker run -it --rm -v $PWD:/app -w /app -p 8080:8080 iron/ruby ruby app.rb
docker run --rm -it -v $PWD:/app -w /app iron/ruby-bundle bundle update
docker run --rm -it -v $PWD:/app -w /app iron/ruby-bundle bundle install --standalone --clean
require_relative 'bundle/bundler/setup'
require 'sinatra'
require "sinatra/json"
port = ENV['PORT'] || 8080
puts "STARTING SINATRA on port #{port}"
set :port, port
set :bind, '0.0.0.0'
get '/' do
docker run --rm -p 8080:8080 username/myapp
docker run --rm -v $PWD:/app -w /app -v /var/run/docker.sock:/var/run/docker.sock treeder/go image username/myapp:latest