feat: replace dotenv-rails with mise for env management#2639
Conversation
Remove dotenv-rails gem and migrate env var loading to mise. Add DB_PORT support to database.yml for configurable Postgres. - Create mise.toml with shared env defaults (DB_HOST, DB_PORT) - Create mise.local.toml.example as a template for local secrets - Create docker-compose.override.yml.example for Docker users to inject GitHub OAuth credentials without dotenv-rails or .env files - Add port: to config/database.yml via DB_PORT env var - Add mise.local.toml and docker-compose.override.yml to .gitignore - Remove gem 'dotenv-rails' from Gemfile - Update AGENTS.md and README with new setup workflows Native install: cp mise.local.toml.example mise.local.toml Docker install: cp docker-compose.override.yml.example docker-compose.override.yml
f653494 to
56a6c1d
Compare
olleolleolle
left a comment
There was a problem hiding this comment.
I believe it is easier to teach mise than the previous system.
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
till
left a comment
There was a problem hiding this comment.
Not a fan of toml 🫣, I prefer direnv. But I agree this looks easier than what was there before.
|
Another, that we use at work is Shadowenv. |
|
Suggestion: Add The PR adds # docker-compose.env
DB_HOST=db
+DB_PORT=5432
DB_USER=postgres
POSTGRES_PASSWORD=passwordThis keeps the What do you think? |
|
Maybe get rid off docker-compose.env? No need to maintain 2 files. |
Moves DB_HOST, DB_USER, POSTGRES_PASSWORD into docker-compose.yml inline environment block, removing the need for a separate env file. Adds DB_PORT for parity with the native mise.toml setup. Also adds docker-compose.env to .gitignore to prevent accidental recreation. Suggested-by: Till <till@example.com>
… feature/mise-env-migration * origin/feature/mise-env-migration: Update Gemfile
|
Nice that we got improvements in, good discussion. |
The local development setup is a bit clunky for me still, because it assumes that Postgres is running on the default port.
I do other work on the same machine, and would like to at least be able to specify which Postgres port to use.
I've been having good results with using
misein my day job, so I am proposing that we use that (or set environment variables manually for those that prefer that), which allows us to also dropdotenvanddotenv-rails. I prefer to have fewer dependencies to manage.Replace
dotenv-rails+.envwithmisefor environment variable management. AddDB_PORTsupport todatabase.ymlfor running multiple Postgres instances.Changes
mise.toml— shared env defaults (DB_HOST,DB_PORT)mise.local.toml.example— template for local secrets (native install)docker-compose.override.yml.example— template for Docker usersDB_PORTsupport toconfig/database.ymlmise.local.tomlanddocker-compose.override.ymlto.gitignoredotenv-railsgemAGENTS.mdandREADME.mdwith new setup workflowsMigration for Contributors
Native:
brew install miseand addmise activateto shell profilecp mise.local.toml.example mise.local.tomland fill in GitHub OAuth credsbundle install(removes dotenv-rails)rm .envDocker:
cp docker-compose.override.yml.example docker-compose.override.yml.envfile needed