Skip to content

Commit

Permalink
Updated Dockerfile so only the appropriate gems for each environment …
Browse files Browse the repository at this point in the history
…are installed.
  • Loading branch information
SarahW91 committed Jun 15, 2022
1 parent f58f1b0 commit cff8d16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN addgroup --gid 1000 barkeeper
RUN adduser --disabled-password --gecos '' --uid 1000 --gid 1000 barkeeper

ARG PUMA_PORT
ARG RAILS_ENV

RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs cmake

Expand All @@ -19,11 +20,11 @@ COPY Gemfile.lock Gemfile.lock
ENV BUNDLER_VERSION=2.3.5
RUN gem install rails bundler:2.3.5

RUN if [ "$RAILS_ENV" = "production" ]; then bundle config set --local without :test,:development; else bundle config set --local without :test; fi
RUN if [ "$RAILS_ENV" = "production" ]; then bundle config set --local without test:development; else bundle config set --local without test; fi
RUN bundle install
RUN chown -R barkeeper:barkeeper $RAILS_ROOT

RUN bundle exec rails assets:precompile
RUN rails assets:precompile
EXPOSE $PUMA_PORT

CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ group :development do
gem 'binding_of_caller' # Extends features of better_errors
gem 'meta_request' # Supporting gem for Google Chrome Rails Panel
gem 'licensed' # Check compatibility of gem licenses
gem 'listen'
gem 'spring', '~> 3' # Spring speeds up development by keeping your application running in the background
gem 'yard' # Documentation generation tool
end
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ DEPENDENCIES
launchy
leaflet-rails
licensed
listen
meta_request
mime-types
nested_form_fields
Expand Down

0 comments on commit cff8d16

Please sign in to comment.