diff --git a/src/helper/class-ee-site.php b/src/helper/class-ee-site.php index 766d414b..56b5f91b 100644 --- a/src/helper/class-ee-site.php +++ b/src/helper/class-ee-site.php @@ -1062,7 +1062,7 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { foreach ( $containers as $container ) { if ( 'nginx' === $container ) { - if ( EE::exec( "docker-compose exec $container nginx -t", true, true ) ) { + if ( EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $container nginx -t", true, true ) ) { \EE\Site\Utils\run_compose_command( 'restart', $container ); } else { \EE\Utils\delem_log( 'site restart stop due to Nginx test failure' ); diff --git a/src/helper/site-utils.php b/src/helper/site-utils.php index d072f7c5..85d4b2f1 100644 --- a/src/helper/site-utils.php +++ b/src/helper/site-utils.php @@ -456,7 +456,7 @@ function restart_site_containers( $site_fs_path, $containers ) { chdir( $site_fs_path ); $all_containers = is_array( $containers ) ? implode( ' ', $containers ) : $containers; - EE::exec( "docker-compose restart $all_containers" ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . " restart $all_containers" ); } /** @@ -469,8 +469,8 @@ function stop_site_containers( $site_fs_path, $containers ) { chdir( $site_fs_path ); $all_containers = is_array( $containers ) ? implode( ' ', $containers ) : $containers; - EE::exec( "docker-compose stop $all_containers" ); - EE::exec( "docker-compose rm -f $all_containers" ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . " stop $all_containers" ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . " rm -f $all_containers" ); } /** @@ -487,7 +487,7 @@ function run_compose_command( $action, $container, $action_to_display = null, $s $display_service = $service_to_display ? $service_to_display : $container; EE::log( ucfirst( $display_action ) . 'ing ' . $display_service ); - EE::exec( "docker-compose $action $container", true, true ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . " $action $container", true, true ); } /** @@ -517,14 +517,14 @@ function set_postfix_files( $site_url, $site_service_dir ) { function configure_postfix( $site_url, $site_fs_path ) { chdir( $site_fs_path ); - EE::exec( 'docker-compose exec postfix postconf -e \'relayhost =\'' ); - EE::exec( 'docker-compose exec postfix postconf -e \'smtpd_recipient_restrictions = permit_mynetworks\'' ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' exec postfix postconf -e \'relayhost =\'' ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' exec postfix postconf -e \'smtpd_recipient_restrictions = permit_mynetworks\'' ); $launch = EE::launch( sprintf( 'docker inspect -f \'{{ with (index .IPAM.Config 0) }}{{ .Subnet }}{{ end }}\' %s', $site_url ) ); $subnet_cidr = trim( $launch->stdout ); - EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'mynetworks = %s 127.0.0.0/8\'', $subnet_cidr ) ); - EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'myhostname = %s\'', $site_url ) ); - EE::exec( 'docker-compose exec postfix postconf -e \'syslog_name = $myhostname\'' ); - EE::exec( 'docker-compose restart postfix' ); + EE::exec( sprintf( \EE_DOCKER::docker_compose_with_custom() . ' exec postfix postconf -e \'mynetworks = %s 127.0.0.0/8\'', $subnet_cidr ) ); + EE::exec( sprintf( \EE_DOCKER::docker_compose_with_custom() . ' exec postfix postconf -e \'myhostname = %s\'', $site_url ) ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' exec postfix postconf -e \'syslog_name = $myhostname\'' ); + EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' restart postfix' ); } /** diff --git a/src/site-type/html.php b/src/site-type/html.php index 3b6ad0ce..eb265f8c 100644 --- a/src/site-type/html.php +++ b/src/site-type/html.php @@ -276,7 +276,7 @@ private function configure_site_files() { // Assign www-data user ownership. chdir( $this->site_data['site_fs_path'] ); - EE::exec( sprintf( 'docker-compose exec --user="root" nginx bash -c "chown -R www-data: %s"', $this->site_data['site_container_fs_path'] ) ); + EE::exec( sprintf( \EE_DOCKER::docker_compose_with_custom() . ' exec --user="root" nginx bash -c "chown -R www-data: %s"', $this->site_data['site_container_fs_path'] ) ); \EE::success( 'Configuration files copied.' ); } catch ( \Exception $e ) {