How to use docker-compose - 10 common examples

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 Soluto / oidc-server-mock / e2e / utils / backend-test-runner.js View on Github external
async teardown() {
    // await dockerCompose.logs(['oidc-server-mock'], options);
    await dockerCompose.down(options);
    await waitFor.stop(30000);
  }
github WordPress / gutenberg / packages / env / lib / env.js View on Github external
);
		} catch ( err ) {
			// Some commit refs need to be set as detached.
			await repo.setHeadDetached( ref );
		}
		spinner.text = `Downloading WordPress@${ ref } 100/100%.`;

		spinner.text = `Starting WordPress@${ ref }.`;
		fs.writeFileSync(
			dockerComposeOptions.config,
			createDockerComposeConfig( cwd, cwdName, cwdTestsPath, context )
		);

		// These will bring up the database container,
		// because it's a dependency.
		await dockerCompose.upMany(
			[ 'wordpress', 'tests-wordpress' ],
			dockerComposeOptions
		);

		const retryableSiteSetup = async () => {
			try {
				await Promise.all( [ setupSite(), setupSite( true ) ] );
			} catch ( err ) {
				await wait( 5000 );
				throw err;
			}
		};
		// Try a few times, in case
		// the database wasn't ready.
		await retryableSiteSetup()
			.catch( retryableSiteSetup )
github jsdevkr / gitCodeShare.com / docker / dev_start.ts View on Github external
const path = require('path');
  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);
}
github jsdevkr / gitCodeShare.com / docker / dev_stop.ts View on Github external
const path = require('path');
  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.down(opts);
}
github rancher / ui / app / components / new-catalog / component.js View on Github external
willSave() {
    this.set('errors', null);
    var ok = this.validate();
    if (!ok) {
      // Validation failed
      return false;
    }

    var files = this.get('selectedTemplateModel.files');

    this.get('environmentResource').setProperties({
      dockerCompose: files['docker-compose.yml'],
      rancherCompose: files['rancher-compose.yml'],
      environment: this.get('answers'),
      externalId: this.get('newExternalId'),
    });

    return true;
  },
github jsdevkr / gitCodeShare.com / 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);
}
github WordPress / gutenberg / packages / env / lib / env.js View on Github external
.then( activateContext.bind( null, context ) )
					.catch( () => {} )
			);
		}
		if ( environment === 'all' || environment === 'tests' ) {
			tasks.push(
				resetDatabase( true )
					.then( setupSite.bind( null, true ) )
					.then( activateContext.bind( null, context, true ) )
					.catch( () => {} )
			);
		}
		await Promise.all( tasks );

		// Remove dangling containers and finish.
		await dockerCompose.rm( dockerComposeOptions );
		spinner.text = `Cleaned ${ description }.`;
	},
};
github Soluto / oidc-server-mock / e2e / utils / backend-test-runner.js View on Github external
async setup() {
    await dockerCompose.buildAll(options);
    await dockerCompose.upAll(options);

    await waitFor.start(30000);
  }
github Soluto / oidc-server-mock / e2e / utils / backend-test-runner.js View on Github external
async setup() {
    await dockerCompose.buildAll(options);
    await dockerCompose.upAll(options);

    await waitFor.start(30000);
  }
github LeanKit-Labs / cowpoke / src / rancher.js View on Github external
const upgradeStack = Promise.coroutine( function *( http, stack, template ) {
	const idParts = stack.externalId.split( "//" );
	const versionInfo = idParts[ 1 ].split( ":" );
	let newStack = yield http.post( stack.actions.upgrade, {
		externalId: `${idParts[ 0 ]}//${versionInfo[ 0 ]}:${ versionInfo[ 1 ] }:${ template.version}`,
		dockerCompose: template[ "docker-compose.yml" ],
		rancherCompose: template[ "rancher-compose.yml" ],
		environment: stack.environment
	} );
	while ( newStack.state !== "upgraded" ) {
		yield Promise.delay( 500 );
		newStack = yield http.get( stack.links.self, {} );
	}
	newStack = yield http.post( newStack.actions.finishupgrade, {} );

	return newStack;
} );