Skip to content

Commit e5532a6

Browse files
committed
Upgrade Ruby from 3.0 => 3.1.4, Rails from 6.0 => 6.1.7
1 parent a032d3c commit e5532a6

File tree

4 files changed

+112
-102
lines changed

4 files changed

+112
-102
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.6
1+
3.1.4

Dockerfile

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Multistage docker build which first builds and bundles all Ruby gems before
22
# creating build targets for the development and production images.
33

4-
# SETUP
54
# Default Ruby version for this project.
6-
ARG RUBY_VERSION=3.0.6
5+
ARG RUBY_VERSION=3.1.4
76

8-
# Base Alpine Ruby image for common setup
9-
FROM ruby:$RUBY_VERSION-alpine as base
7+
# BASE STAGE
8+
# Create a base ruby-alpine stage with common configuration
9+
# that can be used in all other stages.
10+
FROM ruby:$RUBY_VERSION-alpine as ruby-alpine
1011

11-
# Set some environment variables
12-
# ENV BUNDLER_VERSION=2.4.4
12+
# Set environment variables to be shared across all stages.
1313
ENV GEM_HOME=/usr/local/bundle
1414
ENV BUNDLE_PATH=$GEM_HOME
1515
ENV BUNDLE_APP_CONFIG=$BUNDLE_PATH
@@ -21,8 +21,10 @@ RUN apk add --no-cache \
2121
nodejs \
2222
tzdata
2323

24-
# Builder stage for building Ruby gems
25-
FROM base as builder
24+
# BUILDER STAGE
25+
# Build all gems and dependencies in a builder stage,
26+
# whch can then be copied to other stages.
27+
FROM ruby-alpine as builder
2628

2729
# Add packages for required for building
2830
RUN apk add --no-cache \
@@ -37,42 +39,35 @@ WORKDIR /app
3739
# Copy the Gemfile and Gemfile.lock files to the current directory.
3840
COPY Gemfile* .
3941

40-
# Install bundler with specified version.
41-
# RUN gem install bundler -v $BUNDLER_VERSION
42-
43-
# Install gems and remove any unnecessary files from gems.
42+
# Install gems and remove any unnecessary build artifacts.
4443
RUN bundle config force_ruby_platform true \
4544
&& bundle install --jobs 4 --retry 3 \
4645
&& rm -rf $BUNDLE_PATH/cache/*.gem \
47-
&& rm -rf $BUNDLE_PATH/ruby/*/cache
48-
# && find $BUNDLE_PATH/gems/ -name "*.c" -delete \
49-
# && find $BUNDLE_PATH/gems/ -name "*.o" -delete
50-
46+
&& rm -rf $BUNDLE_PATH/ruby/*/cache
5147

5248
# RUNNER STAGE
53-
FROM base as runner
49+
# Copy the needed gems and dependenies from the builder stage to
50+
# create the final minimal image for running the app.
51+
FROM ruby-alpine as runner
5452

53+
# Add packages required for running the app
5554
RUN apk add --no-cache \
55+
chromium \
56+
chromium-chromedriver \
5657
libpq \
5758
mariadb
5859

60+
# Set the working directory for the app.
5961
WORKDIR /app
6062

6163
# Copy the bundle directory from the "builder" image
6264
# and copy all other files to the current directory.
6365
COPY --from=builder $BUNDLE_PATH $BUNDLE_PATH
6466
COPY . .
6567

66-
# Recreate, migrate and seed the database from scratch
67-
# each time the container is built
68-
# RUN rm db/development.sqlite3 db/test.sqlite3 \
69-
# && bundle exec rails db:setup
70-
7168
# Expose port 3000 for the application.
7269
EXPOSE 3000
7370

7471
# Run the command to start the Rails server.
75-
# ENTRYPOINT ["/bin/bash"]
76-
CMD ["bundle", "exec", "rails", "server", "-p", "3000", "-b", "0.0.0.0"]
77-
78-
72+
ENTRYPOINT ["/bin/sh"]
73+
CMD ["/app/entrypoint.sh"]

Gemfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# frozen_string_literal: true
22
source "https://rubygems.org"
33

4-
gem "rails", "6.0.6"
4+
gem "rails", "6.1.7"
55

6-
ruby "3.0.6"
6+
ruby "3.1.4"
77

8-
gem "websocket-driver"
8+
# Add the Contrast Agent gem
9+
gem "contrast-agent"
910

1011
gem "aruba"
1112
gem "bcrypt"
@@ -29,6 +30,7 @@ gem "sqlite3"
2930
gem "turbolinks"
3031
gem "uglifier"
3132
gem "unicorn"
33+
gem "websocket-driver"
3234

3335
# Add SMTP server support using MailCatcher
3436
# NOTE: https://github.com/sj26/mailcatcher#bundler

Gemfile.lock

Lines changed: 85 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,65 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (6.0.6)
5-
actionpack (= 6.0.6)
4+
actioncable (6.1.7)
5+
actionpack (= 6.1.7)
6+
activesupport (= 6.1.7)
67
nio4r (~> 2.0)
78
websocket-driver (>= 0.6.1)
8-
actionmailbox (6.0.6)
9-
actionpack (= 6.0.6)
10-
activejob (= 6.0.6)
11-
activerecord (= 6.0.6)
12-
activestorage (= 6.0.6)
13-
activesupport (= 6.0.6)
9+
actionmailbox (6.1.7)
10+
actionpack (= 6.1.7)
11+
activejob (= 6.1.7)
12+
activerecord (= 6.1.7)
13+
activestorage (= 6.1.7)
14+
activesupport (= 6.1.7)
1415
mail (>= 2.7.1)
15-
actionmailer (6.0.6)
16-
actionpack (= 6.0.6)
17-
actionview (= 6.0.6)
18-
activejob (= 6.0.6)
16+
actionmailer (6.1.7)
17+
actionpack (= 6.1.7)
18+
actionview (= 6.1.7)
19+
activejob (= 6.1.7)
20+
activesupport (= 6.1.7)
1921
mail (~> 2.5, >= 2.5.4)
2022
rails-dom-testing (~> 2.0)
21-
actionpack (6.0.6)
22-
actionview (= 6.0.6)
23-
activesupport (= 6.0.6)
24-
rack (~> 2.0, >= 2.0.8)
23+
actionpack (6.1.7)
24+
actionview (= 6.1.7)
25+
activesupport (= 6.1.7)
26+
rack (~> 2.0, >= 2.0.9)
2527
rack-test (>= 0.6.3)
2628
rails-dom-testing (~> 2.0)
2729
rails-html-sanitizer (~> 1.0, >= 1.2.0)
28-
actiontext (6.0.6)
29-
actionpack (= 6.0.6)
30-
activerecord (= 6.0.6)
31-
activestorage (= 6.0.6)
32-
activesupport (= 6.0.6)
30+
actiontext (6.1.7)
31+
actionpack (= 6.1.7)
32+
activerecord (= 6.1.7)
33+
activestorage (= 6.1.7)
34+
activesupport (= 6.1.7)
3335
nokogiri (>= 1.8.5)
34-
actionview (6.0.6)
35-
activesupport (= 6.0.6)
36+
actionview (6.1.7)
37+
activesupport (= 6.1.7)
3638
builder (~> 3.1)
3739
erubi (~> 1.4)
3840
rails-dom-testing (~> 2.0)
3941
rails-html-sanitizer (~> 1.1, >= 1.2.0)
40-
activejob (6.0.6)
41-
activesupport (= 6.0.6)
42+
activejob (6.1.7)
43+
activesupport (= 6.1.7)
4244
globalid (>= 0.3.6)
43-
activemodel (6.0.6)
44-
activesupport (= 6.0.6)
45-
activerecord (6.0.6)
46-
activemodel (= 6.0.6)
47-
activesupport (= 6.0.6)
48-
activestorage (6.0.6)
49-
actionpack (= 6.0.6)
50-
activejob (= 6.0.6)
51-
activerecord (= 6.0.6)
45+
activemodel (6.1.7)
46+
activesupport (= 6.1.7)
47+
activerecord (6.1.7)
48+
activemodel (= 6.1.7)
49+
activesupport (= 6.1.7)
50+
activestorage (6.1.7)
51+
actionpack (= 6.1.7)
52+
activejob (= 6.1.7)
53+
activerecord (= 6.1.7)
54+
activesupport (= 6.1.7)
5255
marcel (~> 1.0)
53-
activesupport (6.0.6)
56+
mini_mime (>= 1.1.0)
57+
activesupport (6.1.7)
5458
concurrent-ruby (~> 1.0, >= 1.0.2)
55-
i18n (>= 0.7, < 2)
56-
minitest (~> 5.1)
57-
tzinfo (~> 1.1)
58-
zeitwerk (~> 2.2, >= 2.2.2)
59+
i18n (>= 1.6, < 2)
60+
minitest (>= 5.1)
61+
tzinfo (~> 2.0)
62+
zeitwerk (~> 2.3)
5963
addressable (2.8.4)
6064
public_suffix (>= 2.0.2, < 6.0)
6165
aruba (2.1.0)
@@ -99,6 +103,12 @@ GEM
99103
coffee-script-source (1.12.2)
100104
concurrent-ruby (1.2.2)
101105
contracts (0.17)
106+
contrast-agent (7.3.0)
107+
contrast-agent-lib (= 1.1.1)
108+
ffi (~> 1.0)
109+
ougai (>= 1.8, < 3.0.0)
110+
rack (~> 2.0)
111+
contrast-agent-lib (1.1.1)
102112
crass (1.0.6)
103113
cucumber (8.0.0)
104114
builder (~> 3.2, >= 3.2.4)
@@ -233,6 +243,9 @@ GEM
233243
notiffany (0.1.3)
234244
nenv (~> 0.1)
235245
shellany (~> 0.0)
246+
oj (3.15.1)
247+
ougai (2.0.0)
248+
oj (~> 3.10)
236249
parallel (1.23.0)
237250
parser (3.2.2.3)
238251
ast (~> 2.4.1)
@@ -254,20 +267,20 @@ GEM
254267
rack
255268
rack-test (2.1.0)
256269
rack (>= 1.3)
257-
rails (6.0.6)
258-
actioncable (= 6.0.6)
259-
actionmailbox (= 6.0.6)
260-
actionmailer (= 6.0.6)
261-
actionpack (= 6.0.6)
262-
actiontext (= 6.0.6)
263-
actionview (= 6.0.6)
264-
activejob (= 6.0.6)
265-
activemodel (= 6.0.6)
266-
activerecord (= 6.0.6)
267-
activestorage (= 6.0.6)
268-
activesupport (= 6.0.6)
269-
bundler (>= 1.3.0)
270-
railties (= 6.0.6)
270+
rails (6.1.7)
271+
actioncable (= 6.1.7)
272+
actionmailbox (= 6.1.7)
273+
actionmailer (= 6.1.7)
274+
actionpack (= 6.1.7)
275+
actiontext (= 6.1.7)
276+
actionview (= 6.1.7)
277+
activejob (= 6.1.7)
278+
activemodel (= 6.1.7)
279+
activerecord (= 6.1.7)
280+
activestorage (= 6.1.7)
281+
activesupport (= 6.1.7)
282+
bundler (>= 1.15.0)
283+
railties (= 6.1.7)
271284
sprockets-rails (>= 2.0.0)
272285
rails-dom-testing (2.1.1)
273286
activesupport (>= 5.0.0)
@@ -277,12 +290,12 @@ GEM
277290
loofah (~> 2.21)
278291
nokogiri (~> 1.14)
279292
rails-perftest (0.0.7)
280-
railties (6.0.6)
281-
actionpack (= 6.0.6)
282-
activesupport (= 6.0.6)
293+
railties (6.1.7)
294+
actionpack (= 6.1.7)
295+
activesupport (= 6.1.7)
283296
method_source
284-
rake (>= 0.8.7)
285-
thor (>= 0.20.3, < 2.0)
297+
rake (>= 12.2)
298+
thor (~> 1.0)
286299
rainbow (3.1.1)
287300
raindrops (0.20.1)
288301
rake (13.0.6)
@@ -307,14 +320,14 @@ GEM
307320
rspec-mocks (3.12.6)
308321
diff-lcs (>= 1.2.0, < 2.0)
309322
rspec-support (~> 3.12.0)
310-
rspec-rails (5.1.2)
311-
actionpack (>= 5.2)
312-
activesupport (>= 5.2)
313-
railties (>= 5.2)
314-
rspec-core (~> 3.10)
315-
rspec-expectations (~> 3.10)
316-
rspec-mocks (~> 3.10)
317-
rspec-support (~> 3.10)
323+
rspec-rails (6.0.3)
324+
actionpack (>= 6.1)
325+
activesupport (>= 6.1)
326+
railties (>= 6.1)
327+
rspec-core (~> 3.12)
328+
rspec-expectations (~> 3.12)
329+
rspec-mocks (~> 3.12)
330+
rspec-support (~> 3.12)
318331
rspec-support (3.12.1)
319332
rubocop (1.55.1)
320333
json (~> 2.3)
@@ -371,16 +384,15 @@ GEM
371384
test-unit (3.6.1)
372385
power_assert
373386
thor (1.2.2)
374-
thread_safe (0.3.6)
375387
tilt (2.2.0)
376388
timeout (0.4.0)
377389
travis-lint (2.0.0)
378390
json
379391
turbolinks (5.2.1)
380392
turbolinks-source (~> 5.2)
381393
turbolinks-source (5.2.0)
382-
tzinfo (1.2.11)
383-
thread_safe (~> 0.1)
394+
tzinfo (2.0.6)
395+
concurrent-ruby (~> 1.0)
384396
uglifier (4.2.0)
385397
execjs (>= 0.3.0, < 3)
386398
unicode-display_width (2.4.2)
@@ -407,6 +419,7 @@ DEPENDENCIES
407419
bundler-audit
408420
capybara
409421
coffee-rails
422+
contrast-agent
410423
cuprite
411424
database_cleaner
412425
execjs
@@ -424,7 +437,7 @@ DEPENDENCIES
424437
pry-rails
425438
puma
426439
rack-livereload
427-
rails (= 6.0.6)
440+
rails (= 6.1.7)
428441
rails-perftest
429442
rake
430443
rb-fsevent
@@ -443,7 +456,7 @@ DEPENDENCIES
443456
websocket-driver
444457

445458
RUBY VERSION
446-
ruby 3.0.6p216
459+
ruby 3.1.4p223
447460

448461
BUNDLED WITH
449-
2.2.33
462+
2.3.26

0 commit comments

Comments
 (0)