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

Rails 7.1 omnibus #113

Merged
merged 25 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
628f86f
Upgrade Ruby to 3.1.3
danielmorrison Jan 16, 2024
fb28dec
Upgrade Ruby to 3.2.2
danielmorrison Jan 17, 2024
331a744
Upgrade Rails to 7.1.3
danielmorrison Jan 17, 2024
2d8e601
Run rails app:update for Rails 7.1.3
danielmorrison Jan 17, 2024
ab66fef
Upgrade rspec gems and fix a deprecation warning
danielmorrison Jan 17, 2024
348002e
Upgrade importmap-rails
danielmorrison Jan 17, 2024
956d08c
Upgrade honeybadger
danielmorrison Jan 17, 2024
3ad2b51
Switch to cuprite
danielmorrison Jan 17, 2024
3161a22
Upgrade cssbundling-rails
danielmorrison Jan 17, 2024
861650e
Upgrade propshaft
danielmorrison Jan 17, 2024
8543f35
Upgrade factory_bot_rails
danielmorrison Jan 17, 2024
cd135d1
Upgrade faye gems
danielmorrison Jan 17, 2024
fb47082
Upgrade pg
danielmorrison Jan 17, 2024
a2b7a98
Upgrade oj
danielmorrison Jan 17, 2024
35ceafb
Upgrade capybara
danielmorrison Jan 17, 2024
bb94c2a
Upgrade pagy
danielmorrison Jan 17, 2024
e1cde03
Upgrade stackprof
danielmorrison Jan 17, 2024
cb1c64d
Upgrade stats-related gems
danielmorrison Jan 17, 2024
cfb2000
Standard cleanups
danielmorrison Jan 17, 2024
b8ce275
Change autoload lib settings after Rails 7.1 upgrade
danielmorrison Jan 17, 2024
7f9b822
Upgrade Ruby to 3.3.1
gaffneyc May 22, 2024
cbe71c9
Upgrade Overmind to 2.5.1
gaffneyc May 22, 2024
2a4f436
Upgrade NodeJS to 20.13.1 and use NPM instead of Yarn
gaffneyc May 22, 2024
54020c7
docker: Clean up build and actually copy over the code
gaffneyc May 22, 2024
3f117ae
Update dependencies
gaffneyc May 22, 2024
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
67 changes: 45 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,57 @@
# syntax=docker/dockerfile:1
FROM ruby:3.1.2
RUN apt-get update -qq && apt-get install -y postgresql-client
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
COPY mruby_build_config.rb /myapp/mruby_build_config.rb
RUN bundle install
ARG RUBY_VERSION=3.3.1

FROM ruby:$RUBY_VERSION

RUN apt-get update -qq && apt-get upgrade -y && \
apt-get install -y libcurl4 postgresql-client tmux && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

# Update Rubygems and Bundler
RUN \
gem update --system --no-document && \
gem install --no-document bundler

WORKDIR /app
COPY mruby_build_config.rb /app/mruby_build_config.rb

# mruby
RUN git clone https://github.com/mruby/mruby.git && cd mruby && git checkout 3.0.0 && MRUBY_CONFIG="/myapp/mruby_build_config.rb" rake && mv ./bin/mruby /usr/bin/mruby && /usr/bin/mruby -v
RUN git clone https://github.com/mruby/mruby.git && cd mruby && git checkout 3.0.0 && MRUBY_CONFIG="/app/mruby_build_config.rb" rake && mv ./bin/mruby /usr/bin/mruby && /usr/bin/mruby -v

# Overmind
RUN apt-get install -y tmux
RUN curl -sL https://github.com/DarthSim/overmind/releases/download/v2.2.2/overmind-v2.2.2-linux-arm64.gz -o overmind.gz \
ARG OVERMIND_VERSION=2.5.1
RUN curl -sL "https://github.com/DarthSim/overmind/releases/download/v${OVERMIND_VERSION}/overmind-v${OVERMIND_VERSION}-linux-arm64.gz" -o overmind.gz \
&& gunzip overmind.gz \
&& mv overmind /usr/bin/overmind \
&& chmod +x /usr/bin/overmind

# Add Node.js to sources list
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
# Install Node.js version that will enable installation of yarn
RUN apt-get install -y --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN npm install -g yarn
# Install JavaScript dependencies
ARG NODE_VERSION=20.13.1
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
/tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
corepack enable && \
rm -rf /tmp/node-build-master

# Install Ruby dependencies
COPY Gemfile Gemfile.lock /app/
RUN bundle install && \
bundle exec bootsnap precompile --gemfile && \
rm -rf ~/.bundle/ $BUNDLE_PATH/ruby/*/cache $BUNDLE_PATH/ruby/*/bundler/gems/*/.git

# Copy application code
COPY --link . .

# Install NodeJS dependencies
RUN npm install --package-lock-only

# Precompile bootsnap code for faster boot times
RUN \
bundle exec bootsnap precompile app/ lib/ && \
bundle exec rake assets:precompile && \
bundle binstubs --force bundler

# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
ENTRYPOINT ["/app/entrypoint.sh"]
EXPOSE 3000

ENV MRUBY_BIN=/usr/bin/mruby
Expand All @@ -38,4 +61,4 @@ ENV RUBYOPT="--enable=frozen-string-literal"
ENV OVERMIND_NO_PORT=1

# Configure the main process to run when running the image
CMD ["overmind", "start", "-r", "web,monitor_temps,monitor_taps"]
CMD ["overmind", "start", "-r", "web,monitor_temps,monitor_taps"]
11 changes: 4 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source "https://rubygems.org"

ruby "3.1.2"
ruby "3.3.1"

gem "rails", "~> 7.0.1"
gem "rails", "~> 7.1.3"

gem "pg"

Expand All @@ -14,6 +14,7 @@ gem "propshaft"
gem "actionpack-page_caching"
gem "active_model_serializers"
gem "bigdecimal"
gem "bootsnap", require: false
gem "dotenv-rails"
gem "honeybadger"
gem "pagy"
Expand All @@ -28,20 +29,16 @@ group :development do
end

group :test, :development do
gem "cuprite"
gem "domino"
gem "factory_bot_rails"
gem "pry"
gem "rspec-rails"
gem "selenium-webdriver"
gem "standard"
gem "standard-performance"
gem "standard-rails"
end

group :no_require do
gem "faye"
# This gem is normally pulled in via faye, but cuurrent version
# breaks with --enable=frozen-string-literal so remove when version > 0.7.5
# https://github.com/faye/websocket-driver-ruby/pull/85
gem "websocket-driver", github: "faye/websocket-driver-ruby"
end
Loading
Loading