Merge branch 'test' into dev
This commit is contained in:
commit
d7d3c6a98d
|
@ -24,8 +24,8 @@ services:
|
||||||
image: registry.verdnatura.es/salix-mailer:${TAG}
|
image: registry.verdnatura.es/salix-mailer:${TAG}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
build:
|
build:
|
||||||
dockerfile: services/mailer/Dockerfile
|
context: services/mailer
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV
|
- NODE_ENV
|
||||||
volumes:
|
volumes:
|
||||||
- /config/vn-mailer
|
- /containers/vn-mailer:/etc/vn-mailer
|
|
@ -1,30 +1,34 @@
|
||||||
require('require-yaml');
|
require('require-yaml');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const package = require('../package.json');
|
const packageJson = require('../package.json');
|
||||||
let configPath = `/config/${package.name}`;
|
let configPath = `/etc/${packageJson.name}`;
|
||||||
let nginxConfigPath = '/config/nginx';
|
|
||||||
|
|
||||||
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
|
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
|
||||||
|
|
||||||
if (env === 'development') {
|
let config = require('./config/datasources.json');
|
||||||
configPath = `${__dirname}/config`;
|
let configFiles = [
|
||||||
nginxConfigPath = '../../nginx';
|
`${configPath}/datasources.json`,
|
||||||
|
`${configPath}/datasources.${env}.json`
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let configFile of configFiles) {
|
||||||
|
if (fs.existsSync(configFile))
|
||||||
|
Object.assign(config, require(configFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
let config = require(`${configPath}/datasources.json`);
|
let proxyConf = {};
|
||||||
let configEnvFile = `${configPath}/datasources.${env}.json`;
|
let proxyFiles = [
|
||||||
|
'../../nginx/config.yml',
|
||||||
|
`${configPath}/config.yml`,
|
||||||
|
`${configPath}/config.${env}.yml`
|
||||||
|
];
|
||||||
|
|
||||||
if (fs.existsSync(configEnvFile))
|
for (let proxyFile of proxyFiles) {
|
||||||
Object.assign(config, require(configEnvFile));
|
if (fs.existsSync(proxyFile))
|
||||||
|
Object.assign(proxyConf, require(proxyFile));
|
||||||
let proxyConf = require(`${nginxConfigPath}/config.yml`);
|
}
|
||||||
let proxyEnvFile = `${nginxConfigPath}/config.${env}.yml`;
|
|
||||||
|
|
||||||
if (fs.existsSync(proxyEnvFile))
|
|
||||||
Object.assign(proxyConf, require(proxyEnvFile));
|
|
||||||
|
|
||||||
config.proxy = proxyConf;
|
config.proxy = proxyConf;
|
||||||
config.package = package;
|
config.package = packageJson;
|
||||||
config.env = env;
|
config.env = env;
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
Loading…
Reference in New Issue