01 / 05
Dockerfile: use the generated one
`rails new` in Rails 8 gives you a production-grade multi-stage Dockerfile out of the box. Resist the urge to rewrite it. Add build args for asset precompile secrets, then move on.
Dockerfile# rails new -- --skip-jbuilder --database=postgresql # ships a hardened multi-stage Dockerfile. Trust it. FROM ruby:3.3-slim AS base ENV RAILS_ENV=production BUNDLE_DEPLOYMENT=1 BUNDLE_WITHOUT="development:test" # ... see bin/docker-entrypoint for db:prepare on boot