Skip to content

Solution for issue #18 #29

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.


# Mark the yarn lockfile as having been generated.
yarn.lock linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep


/public/assets
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key


/node_modules/*

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
13 changes: 13 additions & 0 deletions .pryrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

if defined?(PryByebug)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end

# Hit Enter to repeat last command
Pry::Commands.command /^$/, 'repeat last command' do
pry_instance.run_command Pry.history.to_a.last
end
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
18 changes: 18 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require:
- rubocop-rails
- rubocop-rspec

AllCops:
NewCops: enable
Exclude:
- 'db/**/*'
- 'script/**/*'
- 'bin/**/*'

Style/Documentation:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'spec/**/*_spec.rb'
- 'config/**/*'
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-3.0.1
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM ruby:3.0.1-alpine as os

ARG BUILD_PACKAGES="build-base g++ gcc make git"
RUN gem install bundler:2.2.15 && \
bundle config --global --jobs `expr $(grep processor /proc/cpuinfo | wc -l) - 1` && \
bundle config build.nokogiri --use-system-libraries && \
apk update && \
apk add --update --no-cache libxslt-dev ${BUILD_PACKAGES} less nodejs \
yarn nginx tzdata curl openssl tar



FROM os as gems

COPY Gemfile .
COPY Gemfile.lock .
COPY package.json .

RUN bundle install && \
apk del build-base g++ gcc make git && \
rm -r /var/cache/apk/*



FROM gems

ARG PORT=3000

ENV TZ America/Sao_Paulo
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV APP_PATH /app

WORKDIR $APP_PATH
EXPOSE $PORT

COPY . $APP_PATH

RUN yarn install
RUN bundle exec rails webpacker:install

CMD ["./scripts/web.sh"]
47 changes: 47 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.0.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.3', '>= 6.1.3.2'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false

group :development, :test do
gem 'pry-byebug', '~> 3.9.0'
gem 'rspec-rails', '~> 5.0.1', require: false
gem 'rubocop', '~> 1.14.0', require: false
gem 'rubocop-performance', '~> 1.11.3', require: false
gem 'rubocop-rails', '~> 2.10.1', require: false
gem 'rubocop-rspec', '~> 2.3.0', require: false
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'listen', '~> 3.3'
gem 'rack-mini-profiler', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
Loading