From 588820cceca0468c1211aeb5cc2943593394cea1 Mon Sep 17 00:00:00 2001 From: Dr Nic Williams Date: Tue, 6 Nov 2018 14:42:38 +1000 Subject: [PATCH] hello world app --- Dockerfile | 9 +++++++++ Gemfile | 8 ++++++++ Gemfile.lock | 24 ++++++++++++++++++++++++ app.rb | 7 +++++++ config.ru | 3 +++ 5 files changed, 51 insertions(+) create mode 100644 Dockerfile create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 app.rb create mode 100644 config.ru diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4ec86d2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ruby:2.5 as build-and-run + +WORKDIR /app +EXPOSE 8080 + +COPY . /app +RUN bundle install + +CMD ["bundle", "exec", "rackup", "-p", "8080", "-o", "0.0.0.0", "-s", "puma"] diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..48428fb --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + +gem "puma" +gem "sinatra" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..4bf9093 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,24 @@ +GEM + remote: https://rubygems.org/ + specs: + mustermann (1.0.3) + puma (3.12.0) + rack (2.0.6) + rack-protection (2.0.4) + rack + sinatra (2.0.4) + mustermann (~> 1.0) + rack (~> 2.0) + rack-protection (= 2.0.4) + tilt (~> 2.0) + tilt (2.0.8) + +PLATFORMS + ruby + +DEPENDENCIES + puma + sinatra + +BUNDLED WITH + 1.16.3 diff --git a/app.rb b/app.rb new file mode 100644 index 0000000..29dc646 --- /dev/null +++ b/app.rb @@ -0,0 +1,7 @@ +require 'sinatra/base' + +class App < Sinatra::Base + get "/" do + "hello world" + end +end diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..46d99e2 --- /dev/null +++ b/config.ru @@ -0,0 +1,3 @@ +require File.expand_path('app', File.dirname(__FILE__)) + +run App