Rails will now generate all the Dockerfiles you need to deploy your application using Kamal, or any other Docker-based deployment setup, when you run rails new.

Ruby on Rails — Rails 7.1: Dockerfiles, BYO Authentication, More Async Queries, and more!

Dockerfileの冒頭はこんな感じ。

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.2.2
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base

# Rails app lives here
WORKDIR /rails

# Set production environment
ENV RAILS_ENV="production" \
    BUNDLE_DEPLOYMENT="1" \
    BUNDLE_PATH="/usr/local/bundle" \
    BUNDLE_WITHOUT="development"

その他のアップデート