Creating Our App Databases
Explore how to properly configure your Rails app to use Postgres instead of sqlite by editing database.yml and docker-compose.yml. Understand setting environment variables for secure database connections and integrating your database service within Docker containers.
When we created our Rails project, we did so with the default settings, which
assumed that we were using sqlite for our database. Now that we are setting up
Postgres instead, the generated database.yml file is not correct. We need to change it to something more suitable.
File database.yml
File in config/database.yml looks like this:
Modification
Let’s edit this file and replace its contents with the following ...