2025-03-14 Rails 7.1 で Dockerfile が自動生成されるようになった
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"
Rails 7.1: Dockerfiles, BYO Authentication, More Async Queries, and more!https://t.co/c32MdUifNs
— Ruby on Rails (@rails) October 5, 2023
その他のアップデート
syntaxちょっとキモいけどRails7.1のこの機能が便利だ » Rails 7.1 gives templates more control over the locals they receive | Shakacode https://t.co/JETg3xWv48
— toshimaru (@toshimaru_e) September 28, 2023
Rails.env.development? || Rails.env.test? が Rails 7.1 で Rails.env.local? でまとめられるようになったの便利 » Rails.env.local? in Rails 7.1 | Saeloun Blog https://t.co/Mi2nnuuNZc
— toshimaru (@toshimaru_e) June 4, 2024