Skip to content

Commit

Permalink
Make port configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Jan 19, 2024
1 parent 275b32d commit 2000cab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
RDB_USER: docker
RDB_PASS: docker
RDB_DB: docker
RDB_PORT: 5432
REFRESH_SECRET: refresh
depends_on:
postgres:
Expand Down
6 changes: 5 additions & 1 deletion src/backend/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2000cab

Please sign in to comment.