Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...finalDockerCompose,
...compose,
};
if (!dotenv) {
return;
}
const dotenvPath = filesystem.resolve(path, '.env');
let finalDotEnv = {};
const exists = await filesystem.exists(dotenvPath);
if (exists) {
const raw = await filesystem.read(dotenvPath);
finalDotEnv = parseEnv(raw);
}
finalDotEnv = {
...finalDotEnv,
...dotenv,
};
await filesystem.write(dotenvPath, stringifyToEnv(finalDotEnv));
});
})
.filter(i => !!i)
.forEach(proxies => {
proxies.forEach(proxy => {
const { port, protocol = 'http', paths } = proxy;
paths.forEach(path => {
routes[path] = `${protocol}://${dockerhost}:${port}`;
});
});
});
const proxy = get('proxy');
if (get('proxy.ssl.key')) {
proxy.ssl.key = await filesystem.read(
filesystem.resolve(get('cwd'), get('proxy.ssl.key'))
);
}
if (get('proxy.ssl.cert')) {
proxy.ssl.cert = await filesystem.read(
filesystem.resolve(get('cwd'), get('proxy.ssl.cert'))
);
}
const httpPort = get('proxy.httpPort', 80);
const environment = {
DEVCTL_PROXY: JSON.stringify(
{
routes,
async function getLastComposeFile() {
const exists = await filesystem.exists(lastDCPath);
if (!exists) {
return null;
}
return filesystem.read(lastDCPath);
}