Read db password from env
This commit is contained in:
parent
4a3ce70751
commit
c83b7535c1
@ -9,6 +9,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./config:/srv/abt/config
|
- ./config:/srv/abt/config
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
environment:
|
||||||
|
- PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
restart: "no"
|
restart: "no"
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
|
@ -48,7 +48,7 @@ class DB {
|
|||||||
private sequelize: Sequelize;
|
private sequelize: Sequelize;
|
||||||
|
|
||||||
constructor(config: DBConfig = {}) {
|
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',
|
host: config.host || 'localhost',
|
||||||
port: config.port || 5432,
|
port: config.port || 5432,
|
||||||
dialect: 'postgres'
|
dialect: 'postgres'
|
||||||
|
@ -11,7 +11,7 @@ interface compositeConfig {
|
|||||||
db?: DBConfig
|
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 web = new Web(config.web);
|
||||||
const buildController = new BuildController();
|
const buildController = new BuildController();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user