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
14 changes: 7 additions & 7 deletions php/EE/Migration/Containers.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private static function migrate_site_containers() {
private static function migrate_global_containers() {

// Upgrade nginx-proxy container
$existing_nginx_proxy_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ee-nginx-proxy', false, true );
$existing_nginx_proxy_image = EE::launch( sprintf( 'docker inspect --format=\'{{.Config.Image}}\' %1$s', EE_PROXY_TYPE ), false, true );
if ( 0 === $existing_nginx_proxy_image->return_code ) {
self::$rsp->add_step(
'upgrade-nginxproxy-container',
Expand Down Expand Up @@ -138,12 +138,12 @@ private static function migrate_global_containers() {
public static function nginxproxy_container_up() {
$EE_CONF_ROOT = EE_CONF_ROOT;
$nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION;
$ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image";
$ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2$s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_CONF_ROOT, $nginx_proxy_image );

default_launch( 'docker rm -f ee-nginx-proxy', false, true );
default_launch( sprintf( 'docker rm -f %1$s', EE_PROXY_TYPE ), false, true );

if ( ! default_launch( $ee_proxy_command, false, true ) ) {
throw new \Exception( ' Unable to upgrade ee-nginx-proxy container' );
throw new \Exception( sprintf( 'Unable to upgrade %1$s container', EE_PROXY_TYPE ) );
}

}
Expand All @@ -158,12 +158,12 @@ public static function nginxproxy_container_up() {
public static function nginxproxy_container_down( $existing_nginx_proxy_image ) {
$EE_CONF_ROOT = EE_CONF_ROOT;
$nginx_proxy_image = trim( $existing_nginx_proxy_image->stout );
$ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image";
$ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2$s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_CONF_ROOT, $nginx_proxy_image );

default_launch( 'docker rm -f ee-nginx-proxy', false, true );
default_launch( sprintf( 'docker rm -f %1$s', EE_PROXY_TYPE ), false, true );

if ( ! default_launch( $ee_proxy_command, false, true ) ) {
throw new \Exception( ' Unable to restore ee-nginx-proxy container' );
throw new \Exception( sprintf( 'Unable to restore %1$s container', EE_PROXY_TYPE ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion php/init-ee.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) );
define( 'EE_START_MICROTIME', microtime( true ) );
define( 'EE_CONF_ROOT', '/opt/easyengine' );
define( 'EE_PROXY_TYPE', 'ee-nginx-proxy' );
define( 'EE_PROXY_TYPE', 'ee-global-nginx-proxy' );

if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) {
define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' );
Expand Down