container env variables for db
This commit is contained in:
@ -7,8 +7,17 @@ app = Flask(__name__)
|
||||
|
||||
def get_conf():
|
||||
'''return settings in settings.yaml file'''
|
||||
settings = dict()
|
||||
with open(os.path.dirname(os.path.realpath(__file__))+"/settings.yaml", 'r') as conf_file:
|
||||
settings = yaml.safe_load(conf_file)
|
||||
settings["db"] = {
|
||||
"host": os.environ.get('POSTGRES_HOST'),
|
||||
"port": os.environ.get('POSTGRES_PORT'),
|
||||
"database": os.environ.get('POSTGRES_DB'),
|
||||
"user": os.environ.get('POSTGRES_USER'),
|
||||
"password": os.environ.get('POSTGRES_PASSWORD')
|
||||
}
|
||||
|
||||
return settings
|
||||
|
||||
@app.route('/init')
|
||||
|
Reference in New Issue
Block a user