Skip to content

Commit

Permalink
Set defaults in container_env for dev usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryguy committed Apr 26, 2024
1 parent 7297ced commit 9143165
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion container-assets/container_env
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ function urlescape() {

safeuser=$(urlescape ${DATABASE_USER})
safepass=$(urlescape ${DATABASE_PASSWORD})
if [ -z "${safeuser}" -o -z "${safepass}" ]; then
DATABASE_USERINFO=""
else
DATABASE_USERINFO="${safeuser}:${safepass}@"
fi

export DATABASE_URL="postgresql://${safeuser}:${safepass}@${DATABASE_HOSTNAME}:${DATABASE_PORT}/${DATABASE_NAME}?encoding=utf8&pool=25&wait_timeout=5"
export DATABASE_URL="postgresql://${DATABASE_USERINFO}${DATABASE_HOSTNAME:-localhost}:${DATABASE_PORT:-5432}/${DATABASE_NAME:-miq_bot_production}?encoding=utf8&pool=25&wait_timeout=5"

0 comments on commit 9143165

Please sign in to comment.