问题
When I scaffold a new Yesod project and select e.g. PostgreSQL as the database, I get config/postgresql.yml
that has the connection parameters. But I want to run my DB in one Docker container and the app in another, and link these via environment variables that contain the DB IP, port and whatnot.
How can I tell Yesod to connect to a database by using a bunch of environment variables for configuration?
回答1:
Yes, you can do this via the following environment variables:
"PGHOST"
"PGPORT"
"PGUSER"
"PGPASS"
"PGDATABASE"
来源:https://stackoverflow.com/questions/25722740/can-yesods-db-be-configured-with-environment-variables