Skip to content

Commit 789ddd7

Browse files
committed
Fix nginx-proxy container issue due to docker-compose version
Signed-off-by: Riddhesh Sanghvi <[email protected]>
1 parent 1101ef1 commit 789ddd7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

php/EE/Migration/GlobalContainers.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public static function down_global_containers( $updated_images ) {
7676
foreach ( $updated_images as $image_name ) {
7777
$global_container_name = $all_global_images[ $image_name ];
7878
$global_service_name = ltrim( $global_container_name, 'services_' );
79-
$global_service_name = rtrim( $global_service_name, '_1' );
80-
EE::debug( "Removing $global_container_name" );
79+
$remove_suffix = explode( '_1', $global_service_name );
80+
$global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0];
81+
EE::debug( "Removing $global_container_name" );
8182

8283
if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) {
8384
if ( ! EE::exec( "docker-compose stop $global_service_name && docker-compose rm -f $global_service_name" ) ) {
@@ -94,8 +95,11 @@ public static function down_global_containers( $updated_images ) {
9495
* @throws \Exception
9596
*/
9697
public static function global_service_up( $service_name ) {
98+
$global_service_name = ltrim( $service_name, 'services_' );
99+
$remove_suffix = explode( '_1', $global_service_name );
100+
$global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0];
97101
EE::debug( 'Start ' . $service_name . ' container up' );
98-
if ( 'global-nginx-proxy' === $service_name ) {
102+
if ( 'global-nginx-proxy' === $global_service_name ) {
99103
\EE\Service\Utils\nginx_proxy_check();
100104
} else {
101105
\EE\Service\Utils\init_global_container( $service_name );

0 commit comments

Comments
 (0)