diff --git a/docker-compose.yml b/docker-compose.yml index 3efa590..000c476 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,8 @@ services: volumes: - ./config:/srv/abt/config - /var/run/docker.sock:/var/run/docker.sock + environment: + - PASSWORD: ${POSTGRES_PASSWORD} restart: "no" ports: - 8080:8080 diff --git a/src/DB.ts b/src/DB.ts index a40deee..1999c4b 100644 --- a/src/DB.ts +++ b/src/DB.ts @@ -48,7 +48,7 @@ class DB { private sequelize: Sequelize; constructor(config: DBConfig = {}) { - this.sequelize = new Sequelize(config.db || 'archery', config.user || 'archery', config.password || '', { + this.sequelize = new Sequelize(config.db || 'archery', config.user || 'archery', process.env.PASSWORD || config.password || '', { host: config.host || 'localhost', port: config.port || 5432, dialect: 'postgres' diff --git a/src/index.ts b/src/index.ts index ab98ded..d6bb1fe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,7 @@ interface compositeConfig { db?: DBConfig } -const config: compositeConfig = JSON.parse(await fs.promises.readFile(process.env.config || path.join('config', 'config.json'), 'utf-8')); +const config: compositeConfig = JSON.parse(await fs.promises.readFile(process.env.config || process.env.CONFIG || path.join('config', 'config.json'), 'utf-8')); const web = new Web(config.web); const buildController = new BuildController();