diff --git a/src/Service_Command.php b/src/Service_Command.php index 4baeeeb..ac01f23 100644 --- a/src/Service_Command.php +++ b/src/Service_Command.php @@ -1,7 +1,5 @@ filter_service( $args ); - EE::exec( "docker-compose stop $service", true, true ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . " stop $service", true, true ); EE::success( sprintf( 'Service %s disabled.', $service ) ); } @@ -157,11 +155,11 @@ public function disable( $args, $assoc_args ) { * * # Restart global service * $ ee service restart newrelic-daemon - * + * */ public function restart( $args, $assoc_args ) { $service = $this->filter_service( $args ); - EE::exec( "docker-compose restart $service", true, true ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . " restart $service", true, true ); EE::success( sprintf( 'Service %s restarted.', $service ) ); } @@ -192,7 +190,7 @@ public function reload( $args, $assoc_args ) { $service = $this->filter_service( $args ); $command = $this->service_reload_command( $service ); if ( $command ) { - EE::exec( "docker-compose exec $service $command", true, true ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $service $command", true, true ); EE::success( sprintf( 'Reloaded %s.', $service ) ); } else { EE::warning( "$service can not be reloaded." ); diff --git a/src/helper/service-utils.php b/src/helper/service-utils.php index df9bd42..c028208 100644 --- a/src/helper/service-utils.php +++ b/src/helper/service-utils.php @@ -82,7 +82,7 @@ function init_global_container( $service, $container = '' ) { if ( IS_DARWIN && GLOBAL_DB === $service && ! $fs->exists( $db_conf_file ) ) { $fs->copy( SERVICE_TEMPLATE_ROOT . '/my.cnf.mustache', $db_conf_file ); } - \EE_DOCKER::boot_container( $container, 'docker-compose up -d ' . $service ); + \EE_DOCKER::boot_container( $container, \EE_DOCKER::docker_compose_with_custom() . ' up -d ' . $service ); return true; } else { return false; @@ -324,11 +324,11 @@ function set_nginx_proxy_version_conf() { chdir( EE_SERVICE_DIR ); $version_line = sprintf( 'add_header X-Powered-By \"EasyEngine v%s\";', EE_VERSION ); $version_file = '/version.conf'; - $version_success = EE::exec( sprintf( 'docker-compose exec global-nginx-proxy bash -c \'echo "%s" > %s\'', $version_line, $version_file ), false, false, [ + $version_success = EE::exec( sprintf( \EE_DOCKER::docker_compose_with_custom() . ' exec global-nginx-proxy bash -c \'echo "%s" > %s\'', $version_line, $version_file ), false, false, [ $version_file, $version_line, ] ); if ( $version_success ) { - EE::exec( 'docker-compose exec global-nginx-proxy bash -c "nginx -t && nginx -s reload"' ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' exec global-nginx-proxy bash -c "nginx -t && nginx -s reload"' ); } }