Skip to content

Commit 3523458

Browse files
committed
Allow setting postgres credentials via env vars in dev/test
1 parent 8f3e086 commit 3523458

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

config/runtime.exs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Config
2+
3+
# Runtime configuration for database
4+
# This file is evaluated after compilation, making it suitable for
5+
# reading environment variables that may change between environments
6+
7+
if config_env() != :prod do
8+
config :dx, Dx.Test.Repo,
9+
hostname: System.get_env("POSTGRES_HOST", "localhost"),
10+
username: System.get_env("POSTGRES_USER", "postgres"),
11+
password: System.get_env("POSTGRES_PASSWORD", "postgres")
12+
end

0 commit comments

Comments
 (0)