diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9c88b7b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM ruby:2.0.0 + +# throw errors if Gemfile has been modified since Gemfile.lock +RUN bundle config --global frozen 1 + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +RUN apt-get update && \ + apt-get install -y nodejs --no-install-recommends && \ + rm -rf /var/lib/apt/lists/* && \ + gem install foreman +# RUN apt-get update && apt-get install -y mysql-client postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* + +# Old Gemfiles for better gem caching +ADD docker/Gemfile /usr/src/app/docker/Gemfile +ADD docker/Gemfile.lock /usr/src/app/docker/Gemfile.lock +RUN bundle install --gemfile /usr/src/app/docker/Gemfile + + +ADD Gemfile /usr/src/app/ +ADD Gemfile.lock /usr/src/app/ +RUN bundle install + +ADD . /usr/src/app + + +EXPOSE 3000 + +CMD ["foreman", "start", "web"] \ No newline at end of file diff --git a/Gemfile b/Gemfile index 4ef0041..ea91a0f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,11 @@ -source ENV['GEMFURY_URL'] if ENV['GEMFURY_URL'] +# source ENV['GEMFURY_URL'] if ENV['GEMFURY_URL'] source 'http://rubygems.org' -ruby '2.1.0' +ruby '2.0.0' gem 'rails', '~> 3.2.13' gem 'unicorn' -gem 'kit_api', '~> 0.2.4', require: false#, path: File.join('..', 'Downloader') +# gem 'kit_api', '~> 0.2.4', require: false#, path: File.join('..', 'Downloader') gem 'yo-ruby', require: false gem 'upsert', require: false # gem 'pg-hstore', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 4324df5..cf81f26 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,4 @@ GEM - remote: https://gem.fury.io/app15743927_heroku_com/ remote: http://rubygems.org/ specs: actionmailer (3.2.13) @@ -34,23 +33,12 @@ GEM i18n (= 0.6.1) multi_json (~> 1.0) addressable (2.3.4) - akami (1.3.0) - gyoku (>= 0.4.0) - nokogiri ancestry (2.0.0) activerecord (>= 3.0.0) arel (3.0.3) autoprefixer-rails (1.0.20140103) execjs awesome_print (1.1.0) - aws-sdk (2.0.38) - aws-sdk-resources (= 2.0.38) - aws-sdk-core (2.0.38) - builder (~> 3.0) - jmespath (~> 1.0) - multi_json (~> 1.0) - aws-sdk-resources (2.0.38) - aws-sdk-core (= 2.0.38) backports (3.3.1) better_errors (0.9.0) coderay (>= 1.0.0) @@ -137,8 +125,6 @@ GEM grape-swagger (0.6.0) grape (>= 0.2.0) kramdown - gyoku (1.3.1) - builder (>= 2.1.2) hashie (3.2.0) high_voltage (1.2.2) hike (1.2.3) @@ -152,23 +138,12 @@ GEM i18n (0.6.1) intercom-rails (0.2.24) activesupport (> 3.0) - jmespath (1.0.2) - multi_json (~> 1.0) journey (1.0.4) json (1.8.1) kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.8.0) - kit_api (0.2.4) - activesupport (>= 3.2.13) - akami (>= 1.2.2) - aws-sdk (>= 1.59.0) - net-ssh (>= 2.6.8) - nokogiri (>= 1.5.0) - nori (>= 2.4.0) - sentry-raven (>= 0.12.1) - typhoeus (>= 0.6.9) kramdown (1.3.0) launchy (2.3.0) addressable (~> 2.3) @@ -186,13 +161,11 @@ GEM multi_json (1.9.0) multi_xml (0.5.4) multipart-post (2.0.0) - net-ssh (2.9.2) newrelic-grape (1.3.0) grape newrelic_rpm newrelic_rpm (3.7.3.204) nokogiri (1.5.11) - nori (2.5.0) paper_trail (3.0.0.beta1) activerecord (>= 3.0, < 5.0) pg (0.17.1) @@ -289,8 +262,6 @@ GEM railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - sentry-raven (0.13.0) - faraday (>= 0.7.6) sequel (3.20.0) simple_form (2.1.0) actionpack (~> 3.0) @@ -386,7 +357,6 @@ DEPENDENCIES hogan_assets intercom-rails (~> 0.2.21) kaminari - kit_api (~> 0.2.4) launchy meta_request (>= 0.2.5) metamagic diff --git a/Procfile b/Procfile index 9249f1e..f50a061 100644 --- a/Procfile +++ b/Procfile @@ -1 +1,2 @@ -web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb \ No newline at end of file +web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb +worker: echo "omg worker wokrer woker" diff --git a/docker/Gemfile b/docker/Gemfile new file mode 100644 index 0000000..ea91a0f --- /dev/null +++ b/docker/Gemfile @@ -0,0 +1,112 @@ +# source ENV['GEMFURY_URL'] if ENV['GEMFURY_URL'] +source 'http://rubygems.org' +ruby '2.0.0' + +gem 'rails', '~> 3.2.13' +gem 'unicorn' + +# gem 'kit_api', '~> 0.2.4', require: false#, path: File.join('..', 'Downloader') +gem 'yo-ruby', require: false +gem 'upsert', require: false +# gem 'pg-hstore', require: false + +# API +gem 'grape', '~> 0.4.1' +gem 'grape-swagger', '> 0.5.0' +gem 'rack-cors' +gem 'garner', '~> 0.3.2' + +# View +gem 'slim-rails' +gem 'simple_form' +gem 'high_voltage' # static pages +gem 'sitemap_generator', require: false +gem 'kaminari' # pagination +gem 'rails_autolink' +gem 'redcarpet' # markdown +gem "autoprefixer-rails" +# gem 'gravtastic' +gem 'metamagic' + +# Database +gem 'pg', '~> 0.17.1' +gem 'ancestry', '~> 2.0.0' +# gem 'redis', :require=> false +gem 'pg_search' # search +gem 'ri_cal' # timetable -> ical +gem 'activerecord-postgres-hstore' +# gem "acts_as_paranoid", "~>0.4.0" +gem 'paper_trail', '>= 3.0.0.beta1' # versioning +# gem 'heroku_backup_task' + +gem "typhoeus"#, require: false +gem 'elasticsearch' + +gem 'font_assets' + +# gem 'validates_timeliness', '~> 3.0' +gem 'intercom-rails', '~> 0.2.21' +gem 'newrelic_rpm' + +group :production do + gem 'newrelic-grape' +end + +group :production, :staging do + gem 'dalli', '>= 2.6.4' # memcach + gem 'rack-cache', :require => 'rack/cache' + # gem 'rack-contrib', :require => 'rack/contrib' + # gem 'therubyracer' + # gem 'less-rails', '~> 2.3.3' + # gem 'thin' + gem 'unicorn-worker-killer' + gem 'rails_12factor' +end + +group :assets do + gem 'sass-rails', '>= 3.1.5' + gem 'coffee-rails', '>= 3.1.1' + gem 'uglifier', '~> 2.5.0' + #gem 'font-awesome-sass', '~> 4.0.0' + gem "font-awesome-rails", '~> 4.0.0' + gem 'hogan_assets' +end + +group :development do + gem 'quiet_assets' + gem 'better_errors' + gem 'binding_of_caller' + gem 'meta_request', '>= 0.2.5' + gem 'taps' + gem 'pry-remote' + gem 'pry-stack_explorer' + # gem 'pry-debugger' +end + +group :development, :test do + # gem 'highline' # user input in rake task + gem 'rspec-rails' + gem 'zeus' + gem 'awesome_print' + gem 'pry-rails' + gem 'launchy' + gem 'thin' +end + +# To use debugger +# gem 'ruby-debug19', :require => 'ruby-debug' + +group :test do + gem 'factory_girl_rails' + gem 'capybara', '~> 2.0' + gem 'poltergeist', '~> 1.5.0' + + gem 'cucumber-rails', require: false + gem 'database_cleaner' + gem 'spork' + gem 'vcr' + gem 'timecop' + gem 'webmock', '>= 1.10' + gem 'rspec_candy' + # gem 'rspec-prof' +end diff --git a/docker/Gemfile.lock b/docker/Gemfile.lock new file mode 100644 index 0000000..cf81f26 --- /dev/null +++ b/docker/Gemfile.lock @@ -0,0 +1,398 @@ +GEM + remote: http://rubygems.org/ + specs: + actionmailer (3.2.13) + actionpack (= 3.2.13) + mail (~> 2.5.3) + actionpack (3.2.13) + activemodel (= 3.2.13) + activesupport (= 3.2.13) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.4) + rack (~> 1.4.5) + rack-cache (~> 1.2) + rack-test (~> 0.6.1) + sprockets (~> 2.2.1) + activemodel (3.2.13) + activesupport (= 3.2.13) + builder (~> 3.0.0) + activerecord (3.2.13) + activemodel (= 3.2.13) + activesupport (= 3.2.13) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activerecord-postgres-hstore (0.7.7) + activerecord (>= 3.1) + pg-hstore (>= 1.1.5) + rake + activeresource (3.2.13) + activemodel (= 3.2.13) + activesupport (= 3.2.13) + activesupport (3.2.13) + i18n (= 0.6.1) + multi_json (~> 1.0) + addressable (2.3.4) + ancestry (2.0.0) + activerecord (>= 3.0.0) + arel (3.0.3) + autoprefixer-rails (1.0.20140103) + execjs + awesome_print (1.1.0) + backports (3.3.1) + better_errors (0.9.0) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + binding_of_caller (0.7.1) + debug_inspector (>= 0.0.1) + builder (3.0.4) + callsite (0.0.11) + capybara (2.2.1) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + cliver (0.3.2) + coderay (1.0.9) + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.7.0) + crack (0.3.2) + cucumber (1.3.2) + builder (>= 2.1.2) + diff-lcs (>= 1.1.3) + gherkin (~> 2.12.0) + multi_json (~> 1.3) + cucumber-rails (1.3.1) + capybara (>= 1.1.2) + cucumber (>= 1.2.0) + nokogiri (>= 1.5.0) + rails (~> 3.0) + daemons (1.1.9) + dalli (2.6.4) + database_cleaner (1.0.1) + debug_inspector (0.0.2) + descendants_tracker (0.0.1) + diff-lcs (1.1.3) + elasticsearch (1.0.1) + elasticsearch-api (= 1.0.1) + elasticsearch-transport (= 1.0.1) + elasticsearch-api (1.0.1) + multi_json + elasticsearch-transport (1.0.1) + faraday + multi_json + erubis (2.7.0) + ethon (0.7.1) + ffi (>= 1.3.0) + eventmachine (1.0.3) + execjs (1.4.0) + multi_json (~> 1.0) + factory_girl (4.4.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.4.1) + factory_girl (~> 4.4.0) + railties (>= 3.0.0) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + ffi (1.9.3) + font-awesome-rails (4.0.0.0) + railties (>= 3.2, < 5.0) + font_assets (0.1.11) + rack + garner (0.3.2) + activesupport + json + multi_json (>= 1.3.0) + rack + gherkin (2.12.0) + multi_json (~> 1.3) + grape (0.4.1) + activesupport + builder + hashie (>= 1.2.0) + multi_json (>= 1.3.2) + multi_xml (>= 0.5.2) + rack (>= 1.3.0) + rack-accept + rack-mount + virtus + grape-swagger (0.6.0) + grape (>= 0.2.0) + kramdown + hashie (3.2.0) + high_voltage (1.2.2) + hike (1.2.3) + hogan_assets (1.6.0) + execjs (>= 1.2.9) + sprockets (>= 2.0.3) + tilt (>= 1.3.3) + httparty (0.13.3) + json (~> 1.8) + multi_xml (>= 0.5.2) + i18n (0.6.1) + intercom-rails (0.2.24) + activesupport (> 3.0) + journey (1.0.4) + json (1.8.1) + kaminari (0.14.1) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + kgio (2.8.0) + kramdown (1.3.0) + launchy (2.3.0) + addressable (~> 2.3) + mail (2.5.4) + mime-types (~> 1.16) + treetop (~> 1.4.8) + meta_request (0.2.6) + callsite + rack-contrib + railties + metamagic (3.1.6) + rails (>= 3.0.0) + method_source (0.8.1) + mime-types (1.25.1) + multi_json (1.9.0) + multi_xml (0.5.4) + multipart-post (2.0.0) + newrelic-grape (1.3.0) + grape + newrelic_rpm + newrelic_rpm (3.7.3.204) + nokogiri (1.5.11) + paper_trail (3.0.0.beta1) + activerecord (>= 3.0, < 5.0) + pg (0.17.1) + pg-hstore (1.2.0) + pg_search (0.6.4) + activerecord (>= 3.1) + activesupport (>= 3.1) + arel + poltergeist (1.5.0) + capybara (~> 2.1) + cliver (~> 0.3.1) + multi_json (~> 1.0) + websocket-driver (>= 0.2.0) + polyglot (0.3.3) + pry (0.9.12.2) + coderay (~> 1.0.5) + method_source (~> 0.8) + slop (~> 3.4) + pry-rails (0.3.2) + pry (>= 0.9.10) + pry-remote (0.1.7) + pry (~> 0.9) + slop (~> 3.0) + pry-stack_explorer (0.4.9.1) + binding_of_caller (>= 0.7) + pry (>= 0.9.11) + quiet_assets (1.0.2) + railties (>= 3.1, < 5.0) + rack (1.4.5) + rack-accept (0.4.5) + rack (>= 0.4) + rack-cache (1.2) + rack (>= 0.4) + rack-contrib (1.1.0) + rack (>= 0.9.1) + rack-cors (0.2.8) + rack + rack-mount (0.8.3) + rack (>= 1.0.0) + rack-ssl (1.3.3) + rack + rack-test (0.6.2) + rack (>= 1.0) + rails (3.2.13) + actionmailer (= 3.2.13) + actionpack (= 3.2.13) + activerecord (= 3.2.13) + activeresource (= 3.2.13) + activesupport (= 3.2.13) + bundler (~> 1.0) + railties (= 3.2.13) + rails_12factor (0.0.2) + rails_serve_static_assets + rails_stdout_logging + rails_autolink (1.1.0) + rails (> 3.1) + rails_serve_static_assets (0.0.2) + rails_stdout_logging (0.0.3) + railties (3.2.13) + actionpack (= 3.2.13) + activesupport (= 3.2.13) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (>= 0.14.6, < 2.0) + raindrops (0.10.0) + rake (10.1.1) + rdoc (3.12.2) + json (~> 1.4) + redcarpet (3.0.0) + rest-client (1.6.7) + mime-types (>= 1.16) + ri_cal (0.8.8) + rspec (2.12.0) + rspec-core (~> 2.12.0) + rspec-expectations (~> 2.12.0) + rspec-mocks (~> 2.12.0) + rspec-core (2.12.2) + rspec-expectations (2.12.1) + diff-lcs (~> 1.1.3) + rspec-mocks (2.12.2) + rspec-rails (2.12.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 2.12.0) + rspec-expectations (~> 2.12.0) + rspec-mocks (~> 2.12.0) + rspec_candy (0.2.9) + rspec + sneaky-save + sass (3.2.12) + sass-rails (3.2.6) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + sequel (3.20.0) + simple_form (2.1.0) + actionpack (~> 3.0) + activemodel (~> 3.0) + sinatra (1.0) + rack (>= 1.0) + sitemap_generator (4.1.0) + builder + slim (2.0.0) + temple (~> 0.6.5) + tilt (~> 1.3, >= 1.3.3) + slim-rails (2.0.1) + actionpack (>= 3.0, < 4.1) + activesupport (>= 3.0, < 4.1) + railties (>= 3.0, < 4.1) + slim (~> 2.0) + slop (3.4.5) + sneaky-save (0.0.4) + activerecord (>= 3.2.0) + spork (0.9.2) + sprockets (2.2.2) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + taps (0.3.24) + rack (>= 1.0.1) + rest-client (>= 1.4.0, < 1.7.0) + sequel (~> 3.20.0) + sinatra (~> 1.0.0) + temple (0.6.5) + thin (1.5.1) + daemons (>= 1.0.9) + eventmachine (>= 0.12.6) + rack (>= 1.0.0) + thor (0.18.1) + tilt (1.4.1) + timecop (0.6.1) + treetop (1.4.12) + polyglot + polyglot (>= 0.3.1) + typhoeus (0.6.9) + ethon (>= 0.7.1) + tzinfo (0.3.38) + uglifier (2.5.0) + execjs (>= 0.3.0) + json (>= 1.8.0) + unicorn (4.6.2) + kgio (~> 2.6) + rack + raindrops (~> 0.7) + unicorn-worker-killer (0.4.2) + unicorn (~> 4) + upsert (2.0.3) + vcr (2.5.0) + virtus (0.5.5) + backports (~> 3.3) + descendants_tracker (~> 0.0.1) + webmock (1.11.0) + addressable (>= 2.2.7) + crack (>= 0.3.2) + websocket-driver (0.3.2) + xpath (2.0.0) + nokogiri (~> 1.3) + yo-ruby (0.1.4) + httparty (>= 0.13.1) + zeus (0.13.3) + method_source (>= 0.6.7) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord-postgres-hstore + ancestry (~> 2.0.0) + autoprefixer-rails + awesome_print + better_errors + binding_of_caller + capybara (~> 2.0) + coffee-rails (>= 3.1.1) + cucumber-rails + dalli (>= 2.6.4) + database_cleaner + elasticsearch + factory_girl_rails + font-awesome-rails (~> 4.0.0) + font_assets + garner (~> 0.3.2) + grape (~> 0.4.1) + grape-swagger (> 0.5.0) + high_voltage + hogan_assets + intercom-rails (~> 0.2.21) + kaminari + launchy + meta_request (>= 0.2.5) + metamagic + newrelic-grape + newrelic_rpm + paper_trail (>= 3.0.0.beta1) + pg (~> 0.17.1) + pg_search + poltergeist (~> 1.5.0) + pry-rails + pry-remote + pry-stack_explorer + quiet_assets + rack-cache + rack-cors + rails (~> 3.2.13) + rails_12factor + rails_autolink + redcarpet + ri_cal + rspec-rails + rspec_candy + sass-rails (>= 3.1.5) + simple_form + sitemap_generator + slim-rails + spork + taps + thin + timecop + typhoeus + uglifier (~> 2.5.0) + unicorn + unicorn-worker-killer + upsert + vcr + webmock (>= 1.10) + yo-ruby + zeus