How to use the docker-compose.up function in docker-compose

To help you get started, we’ve selected a few docker-compose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jsdevkr / / docker / dev_start.ts View on Github external
const compose = require('docker-compose');
  // const dockerode = require('dockerode');

  const kill = require('kill-port');
  await kill(parseInt(process.env.FRONT_PORT, 10) || 3000);
  await kill(parseInt(process.env.BACKEND_PORT, 10) || 3030);

  // const prod = process.env.NODE_ENV === 'production';
  const opts = {
    cwd: path.join(__dirname),
    log: true,
    config: 'docker-compose-dev.yml',

  await compose.buildAll(opts);
  await compose.up(opts);