Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading database credentials from environment instead of config file #179

Open
wouterdedroog opened this issue Sep 23, 2023 · 1 comment

Comments

@wouterdedroog
Copy link

Hi, I want to host a Ruby application using standalone_migrations in Docker but I haven't figured out a way to do this without passing a database.yml file to the container. Is it possible to set the database credentials using environment variables?

@gugulen0k
Copy link

I thinks it's a bit late, but may be this will help someone =)
To use environment variables in database configuration file you have to:

  1. Install ruby gem for managing environment variables. For example: dotenv from here https://rubygems.org/gems/dotenv
  2. Insert in Rakefile following line
 require 'dotenv/load'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants