-
Notifications
You must be signed in to change notification settings - Fork 13
Rails 6: Graphql class based approach #1623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM ruby:2.7-slim | ||
WORKDIR /app | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y \ | ||
build-essential \ | ||
libpq-dev \ | ||
nodejs \ | ||
libjemalloc2 && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# configure jemalloc v5 with v3 behaviours (trade ram usage over performance) | ||
# https://twitter.com/nateberkopec/status/1442894624935137288 | ||
# https://github.com/code-dot-org/code-dot-org/blob/5c8b24674d1c2f7e51e85dd32124e113dc423d84/cookbooks/cdo-jemalloc/attributes/default.rb#L10 | ||
ENV MALLOC_CONF="narenas:2,background_thread:true,thp:never,dirty_decay_ms:1000,muzzy_decay_ms:0" | ||
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 | ||
|
||
ADD ./Gemfile.next /app/ | ||
ADD ./Gemfile.next.lock /app/ | ||
|
||
# ensure we use the rails-next gemfile setup to ensure we boot the upgraded libaries | ||
ENV BUNDLE_GEMFILE=Gemfile.next | ||
|
||
ENV PORT=80 | ||
ARG RAILS_ENV=production | ||
ENV RAILS_ENV=$RAILS_ENV | ||
|
||
RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1` && \ | ||
if echo "development test" | grep -w "$RAILS_ENV"; then \ | ||
bundle install; \ | ||
else bundle install --without development test; fi | ||
|
||
ADD ./ /app | ||
|
||
RUN (cd /app && mkdir -p tmp/pids) | ||
RUN (cd /app && SECRET_KEY_BASE=1 bundle exec rails assets:precompile) | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["/app/docker/start-puma.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
def next? | ||
File.basename(__FILE__) == "Gemfile.next" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
source 'https://rubygems.org' | ||
|
||
git_source(:github) do |repo_name| | ||
|
@@ -8,7 +11,11 @@ end | |
gem 'active_record_extended' | ||
gem 'httparty' | ||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | ||
gem 'rails', '~> 5.2' | ||
if next? | ||
gem "rails", '~> 6.0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
else | ||
gem 'rails', '~> 5.2' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bundler/DuplicatedGem: Gem rails requirements already given on line 15 of the Gemfile. |
||
end | ||
# Use postgresql as the database for Active Record | ||
gem 'pg', '~> 1.3' | ||
# Use Puma as the app server | ||
|
@@ -42,6 +49,8 @@ gem 'logstash-event' | |
gem "sentry-raven" | ||
gem 'omniauth' | ||
gem 'omniauth-zooniverse' | ||
# for omniauth-zooniverse | ||
gem 'omniauth-oauth2' | ||
gem 'responders' | ||
gem 'listen', '>= 3.0.5', '< 3.8' | ||
gem 'rest-client', '> 2.0' | ||
|
@@ -71,13 +80,15 @@ group :development, :test do | |
# Call 'byebug' anywhere in the code to stop execution and get a debugger console | ||
gem 'byebug', platform: [:mri, :mingw, :x64_mingw] | ||
gem 'pry-byebug' | ||
gem 'rspec-rails', '~> 3.8' | ||
# gem 'rspec-rails', '~> 3.8' | ||
gem 'rspec-rails' | ||
gem 'pry-rails' | ||
gem 'webmock' | ||
gem 'spring-commands-rspec' | ||
gem 'rubocop' | ||
gem 'factory_bot_rails' | ||
gem 'rails-controller-testing' | ||
gem 'ten_years_rails' | ||
end | ||
|
||
group :development do | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.