stop.js 491 B

1234567891011121314151617
  1. const colors = require('colors');
  2. const docker = require('docker-compose/dist/v2');
  3. const ProjectEnvironment = require('../classes/ProjectEnvironment');
  4. const log = require('../inc/log');
  5. const stopServices = async (projectEnv) => {
  6. await docker.down(projectEnv.getDockerOptions());
  7. };
  8. module.exports = (env) => {
  9. const projectEnv = new ProjectEnvironment(process.cwd(), env);
  10. log.log("Shutting down project (%s environment)...", colors.bold(env));
  11. stopServices(projectEnv);
  12. };