One thing I don't get about the current Rails direction is pushing hard to use SQLite and removing external dependencies but at the same time also advocating to use Docker. Running Postgres and Redis in Docker is a matter of adding a few lines of YAML to a file once and never thinking about it again. I have done this for 10 years, it is painless. I'm all for reducing moving parts and would also choose the same strate…
> I have done this for 10 years > it is painless Huh, I wonder why.
I didn't start with 10 years of experience if that's what you mean.
A basic Redis config inside of Docker Compose could be:
services:
redis:
image: "redis:7.4.1-bookworm"
restart: "unless-stopped"
volumes:
- "redis:/data"
volumes:
redis: {}
Now you have Redis running with your project and you can use "redis" as the hostname to connect from your app. It even persists to disk with a volume if needed.It's similar for Postgres except you'd also want to set the PG username and password with environment variables so your initial user and DB get set up with reasonable defaults.
A working version of this is in my Rails starter app at: https://github.com/nickjj/docker-rails-example
It sets a few more properties but those aren't essential to get going.