Skip to content
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

Fix docker setup #298

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# Also we don't use -onbuild as they're deprecated
# https://github.com/docker-library/official-images/issues/2076
FROM ruby:3.0.2 as dev
FROM ruby:3.0.6 as dev
LABEL maintainer="[email protected]"

# Installs system dependencies
Expand Down Expand Up @@ -65,7 +65,7 @@ RUN mkdir /db-init && chown 1000 /db-init
USER decidim

# Update system gems
RUN gem install bundler:2.4.7
RUN gem install bundler
RUN gem update --system

# Copy Gemfile and install bundle dependencies
Expand Down
1 change: 1 addition & 0 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e

gem install bundler
bundle install

bin/rails db:migrate RAILS_ENV=development
Expand Down
1 change: 1 addition & 0 deletions .docker/webpack-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e

yarn add [email protected] --dev
yarn install

exec "$@"
17 changes: 6 additions & 11 deletions bin/bundle-binstub
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ m = Module.new do
bundler_version = nil
update_index = nil
ARGV.each_with_index do |a, i|
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Rubocop] reported by reviewdog 🐶
[Correctable] Style/IfUnlessModifier: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.

bundler_version = a
end
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
Expand All @@ -47,7 +47,7 @@ m = Module.new do
def lockfile
lockfile =
case File.basename(gemfile)
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Rubocop] reported by reviewdog 🐶
[Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Rubocop] reported by reviewdog 🐶
[Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

else "#{gemfile}.lock"
end
File.expand_path(lockfile)
Expand All @@ -62,22 +62,17 @@ m = Module.new do

def bundler_requirement
@bundler_requirement ||=
env_var_version || cli_arg_version ||
bundler_requirement_for(lockfile_version)
env_var_version ||
cli_arg_version ||
bundler_requirement_for(lockfile_version)
end

def bundler_requirement_for(version)
return "#{Gem::Requirement.default}.a" unless version

bundler_gem_version = Gem::Version.new(version)

requirement = bundler_gem_version.approximate_recommendation

return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0")

requirement += ".a" if bundler_gem_version.prerelease?

requirement
bundler_gem_version.approximate_recommendation
end

def load_bundler!
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-standard": "^3.1.0",
"sass-embedded": "~1.57.1",
"stylelint": "^13.11.0"
"stylelint": "^13.11.0",
"webpack-dev-server": "4.15.1"
}
}
Loading
Loading