mirror of
https://github.com/netfun2000/hipudding-teslamate.git
synced 2026-02-27 09:44:28 +08:00
Support custom database port through environment DATABASE_PORT env var
Based on example from https://github.com/elixir-ecto/ecto
This commit is contained in:
committed by
Adrian Kumpf
parent
9cff83afb7
commit
9bb1b446ea
@@ -243,6 +243,7 @@ TeslaMate uses environment variables for runtime configuration.
|
||||
| DATABASE_PASS | User password (**required**) | / |
|
||||
| DATABASE_NAME | The database to connect to (**required**) | / |
|
||||
| DATABASE_HOST | Hostname of the database server (**required**) | / |
|
||||
| DATABASE_PORT | Port of the database server | 5432 |
|
||||
| DATABASE_POOL_SIZE | Size of the database connection pool | 5 |
|
||||
| TESLA_USERNAME | Username / email of your Tesla account (**required**) | / |
|
||||
| TESLA_PASSWORD | Password of your Tesla account (**required**) | / |
|
||||
|
||||
@@ -13,6 +13,7 @@ config :teslamate, TeslaMate.Repo,
|
||||
password: System.fetch_env!("DATABASE_PASS"),
|
||||
database: System.fetch_env!("DATABASE_NAME"),
|
||||
hostname: System.fetch_env!("DATABASE_HOST"),
|
||||
port: System.get_env("DATABASE_PORT", "5432"),
|
||||
pool_size: System.get_env("DATABASE_POOL_SIZE", "5") |> String.to_integer()
|
||||
|
||||
config :teslamate, TeslaMateWeb.Endpoint,
|
||||
|
||||
Reference in New Issue
Block a user