diff --git a/docker-compose.yml b/docker-compose.yml index 9adf0f05..3467a16b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: RDB_USER: docker RDB_PASS: docker RDB_DB: docker + RDB_PORT: 5432 REFRESH_SECRET: refresh depends_on: postgres: diff --git a/src/backend/util.ts b/src/backend/util.ts index e3ec7829..59ef2281 100644 --- a/src/backend/util.ts +++ b/src/backend/util.ts @@ -45,12 +45,16 @@ export const robustSrcPath = __dirname.includes('dist/') return `${__dirname}/../../dist/src/${path}`; }; +const port: number = process.env.RDB_PORT + ? parseInt(process.env.RDB_PORT) + : 5432; + export const dbConfig = { user: process.env.RDB_USER || '', password: process.env.RDB_PASS || '', host: process.env.RDB_HOST || 'localhost', database: process.env.RDB_DB || 'rdb_smde2', - port: 5432 + port }; export const refreshSecret = diff --git a/src/index.ts b/src/index.ts index 8dc5d899..e0f4bae0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,6 +56,8 @@ log.info('Starting ReBenchDB Version ' + rebenchVersion); const app = new Koa(); const router = new Router(); +log.info('Initialize Database with dbConfig: ' + JSON.stringify(dbConfig)); + export const db = new DatabaseWithPool( dbConfig, statsConfig.numberOfBootstrapSamples,