make dokku config more reliable

This commit is contained in:
Sam Dodrill 2015-01-09 17:02:49 -08:00
parent 7cbaa1915f
commit 01183ab1bc
1 changed files with 8 additions and 5 deletions

View File

@ -15,8 +15,11 @@ config "docker", ->
postgres ->
backend "pgmoon"
host os.getenv "DB_HOST"
port os.getenv "DB_PORT"
user os.getenv "DB_USER"
password os.getenv "DB_PASS"
database os.getenv "DB_NAME"
if os.getenv "DB_USER"
host assert os.getenv "POSTGRESQL_PORT_5432_TCP_ADDR"
port assert os.getenv "POSTGRESQL_PORT_5432_TCP_PORT"
user assert os.getenv "DB_USER"
password assert os.getenv "DB_PASS"
database assert os.getenv "DB_NAME"
else
postgresql_url assert os.getenv "DATABASE_URL"