updated to use environment variables for the database host and port to support docker deployment

pull/1/head
Chris Veilleux 2018-08-24 17:26:13 -05:00
parent d666645662
commit 2ab6a1df28
1 changed files with 3 additions and 4 deletions

View File

@ -1,12 +1,11 @@
"""Database access utility functions"""
from os import environ
from mongoengine import connect
def connect_to_skill_db():
"""Establish a connection to the Mongo skills database."""
# TODO: replace with production logic to ge the correct host and port for the skill DB
host = 'localhost'
port = 27017
host = environ['SKILL_DB_HOST']
port = int(environ['SKILL_DB_PORT'])
database = 'skillDB'
connect(database, host=host, port=port)