diff --git a/.dockerignore b/.dockerignore index 6b8710a..f9d7c16 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,8 @@ .git +.gitignore +.travis.yml +CHANGELOG.md +CONTRIBUTING.md +docker-compose.yml +Jenkinsfile +LICENSE diff --git a/Dockerfile b/Dockerfile index 7eb0646..bca014c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,13 @@ -FROM ubuntu:trusty +FROM ruby:onbuild EXPOSE 4567 -RUN apt-get update -RUN apt-get install -yq ruby ruby-dev build-essential git npm -RUN gem install --no-ri --no-rdoc bundler -ADD Gemfile ./app/Gemfile -ADD Gemfile.lock ./app/Gemfile.lock -ADD Rakefile ./app/Rakefile -ADD api ./app/api -ADD source ./app/source -ADD config.rb ./app/config.rb -WORKDIR app +RUN apt-get update && apt-get install -y git +RUN gem install bundler RUN bundle install -ENTRYPOINT ["bundle", "exec"] -CMD ["rake", "run", "port=8000"] + +ENTRYPOINT ["rake"] +CMD ["run"] # 1) Build: docker run devbamboracom rake build -# 2) Run: docker run devbamboracom -# or: docker run devbamboracom rake run port=8080 -# to specify the port. \ No newline at end of file +# 2) Run: docker run devbamboracom \ No newline at end of file diff --git a/Gemfile b/Gemfile index 0933b9d..8f43911 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ gem 'middleman-syntax', '~> 2.0.0' gem 'middleman-autoprefixer', '~> 2.4.4' gem 'rouge', '~> 1.9.0' gem 'redcarpet', '~> 3.3.2' +gem 'puma', '~> 3.4.0' gem 'rake', '~> 10.4.2' gem 'therubyracer', '~> 0.12.1', platforms: :ruby diff --git a/Gemfile.lock b/Gemfile.lock index c907f2b..27f76b3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -91,6 +91,7 @@ GEM tilt (~> 1.4.1) padrino-support (0.12.5) activesupport (>= 3.1) + puma (3.4.0) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) @@ -136,6 +137,7 @@ DEPENDENCIES middleman-autoprefixer (~> 2.4.4) middleman-gh-pages (~> 0.0.3) middleman-syntax (~> 2.0.0) + puma (~> 3.4.0) rake (~> 10.4.2) redcarpet (~> 3.3.2) rouge (~> 1.9.0) diff --git a/Rakefile b/Rakefile index 48174ec..3d197b5 100644 --- a/Rakefile +++ b/Rakefile @@ -3,10 +3,6 @@ require 'rake/clean' CLOBBER.include('build') -task :dependencies do - puts "installing node-static" - sh "npm install -g node-static" -end task :build_slate do puts "building slate" @@ -17,14 +13,11 @@ task :copy_swagger do puts "copying swagger UI" sh "cp build public -r" sh "cp -r api public/api" - sh "find ." end -task :run do - puts "static -a 0.0.0.0 -p "+ENV['port'] - sh "static -a 0.0.0.0 -p "+ENV['port'] +task :run_server do + sh "bundle install" + sh "ruby -run -ehttpd ./public -p4567" end +task :run => [:build_slate, :copy_swagger, :run_server] -task :build => [:dependencies, :build_slate, :copy_swagger] - -task :default => [:build] \ No newline at end of file