diff --git a/.gitignore b/.gitignore index 40e61a92..8e7bbe1b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ # testing /.rspec /coverage + +/node_modules diff --git a/Dockerfile b/Dockerfile index d3a47ff6..b8a5e974 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,24 @@ FROM ruby:2.4.2 -RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs +RUN apt-get update -qq && apt-get install -y build-essential libpq-dev + +# Node.js +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \ + && apt-get install -y nodejs + +# yarn +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -\ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update \ + && apt-get install -y yarn + RUN mkdir /app WORKDIR /app ADD Gemfile /app/Gemfile ADD Gemfile.lock /app/Gemfile.lock RUN bundle install +ADD package.json /app/package.json +ADD yarn.lock /app/yarn.lock +RUN yarn install # Fill in your Twitch client information if you want login/signup to work # You can make a Twitch client at https://dev.twitch.tv/dashboard/apps diff --git a/Dockerfile-production b/Dockerfile-production index c0c29031..64b69fe8 100644 --- a/Dockerfile-production +++ b/Dockerfile-production @@ -2,12 +2,26 @@ # production. If you're not, look at Dockerfile instead. FROM ruby:2.4.2 -RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs +RUN apt-get update -qq && apt-get install -y build-essential libpq-dev + +# Node.js +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \ + && apt-get install -y nodejs + +# yarn +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -\ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update \ + && apt-get install -y yarn + RUN mkdir /app WORKDIR /app ADD Gemfile /app/Gemfile ADD Gemfile.lock /app/Gemfile.lock RUN bundle install +ADD package.json /app/package.json +ADD yarn.lock /app/yarn.lock +RUN yarn install # You don't need to change anything in this file by hand! Set the below env vars as desired in your host, then use # cat Dockerfile | envsubst > Dockerfile.tmp && mv -f Dockerfile.tmp Dockerfile diff --git a/Gemfile b/Gemfile index 7fe04987..da239d5f 100644 --- a/Gemfile +++ b/Gemfile @@ -91,7 +91,6 @@ gem 'd3-rails', '~> 3.5.17' gem 'jquery-rails' gem 'jquery-ui-rails' gem 'js_cookie_rails' -gem 'momentjs-rails' gem 'numeraljs-rails' gem 'spinjs-rails' gem 'tipsy-rails' diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index adee5ab5..ef728ba9 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -22,7 +22,7 @@ //= require tipsy //= require turbolinks //= require underscore -//= require moment +//= require moment/moment //= require d3 //= require c3 //= require clipboard diff --git a/package.json b/package.json index e30591f1..da825580 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,7 @@ { "name": "splits-io", "private": true, - "dependencies": {} + "dependencies": { + "moment": "^2.20.1" + } } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..0e7773fa --- /dev/null +++ b/yarn.lock @@ -0,0 +1,7 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +moment@^2.20.1: + version "2.20.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd"