Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/helper/class-ee-site.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
20 changes: 10 additions & 10 deletions src/helper/site-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
}

/**
Expand All @@ -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" );
}

/**
Expand All @@ -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 );
}

/**
Expand Down Expand Up @@ -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' );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/site-type/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down