Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function startFluentd() {
if (process.env.FLUENTD_SERVICE_HOST != null) return;
const container = await new GenericContainer(
'fluent/fluentd',
'v1.7.4-debian-1.0',
)
.withName('fluentd_lb4')
.withExposedPorts(24224, 9880)
.withEnv('FLUENTD_CONF', 'fluentd.conf')
.withBindMount(ETC_DIR, '/fluentd/etc', 'ro')
.start();
process.env.FLUENTD_SERVICE_HOST = container.getContainerIpAddress();
process.env.FLUENTD_SERVICE_PORT_TCP = container
.getMappedPort(24224)
.toString();
process.env.FLUENTD_SERVICE_PORT_HTTP = container
.getMappedPort(9880)
.toString();
return container;