Skip to content

Commit b9304d4

Browse files
authored
Merge branch 'develop' into fix/GH-EE#1204
2 parents fd2b549 + 9d82df8 commit b9304d4

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/Site_WP_Docker.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,14 @@ public function generate_docker_compose_yml( array $filters = [] ) {
185185

186186
$binding = [
187187
'services' => $base,
188-
'network' => true,
188+
'network' => [
189+
'networks_labels' => [
190+
'label' => [
191+
[ 'name' => 'org.label-schema.vendor=EasyEngine' ],
192+
[ 'name' => 'io.easyengine.site=${VIRTUAL_HOST}' ],
193+
],
194+
],
195+
],
189196
];
190197

191198
$docker_compose_yml = mustache_render( SITE_WP_TEMPLATE_ROOT . '/docker-compose.mustache', $binding );

src/WordPress.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function create( $args, $assoc_args ) {
208208
$this->site_data['db_port'] = empty( $arg_host_port[1] ) ? '3306' : $arg_host_port[1];
209209
}
210210

211-
$this->site_data['app_admin_email'] = \EE\Utils\get_flag_value( $assoc_args, 'admin_email', strtolower( 'admin@' . $this->site_data['site_url'] ) );
211+
$this->site_data['app_admin_email'] = \EE\Utils\get_flag_value( $assoc_args, 'admin-email', strtolower( 'admin@' . $this->site_data['site_url'] ) );
212212
$this->skip_install = \EE\Utils\get_flag_value( $assoc_args, 'skip-install' );
213213
$this->skip_status_check = \EE\Utils\get_flag_value( $assoc_args, 'skip-status-check' );
214214
$this->force = \EE\Utils\get_flag_value( $assoc_args, 'force' );
@@ -548,7 +548,8 @@ private function install_wp() {
548548
$maybe_multisite_type = $this->site_data['app_sub_type'] === 'subdom' ? '--subdomains' : '';
549549
}
550550

551-
$install_command = sprintf( 'docker-compose exec --user=\'www-data\' php wp core %s --url=\'%s\' --title=\'%s\' --admin_user=\'%s\'', $wp_install_command, $this->site_data['site_url'], $this->site_data['app_admin_url'], $this->site_data['app_admin_username'] );
551+
$prefix = ( $this->site_data['site_ssl'] ) ? 'https://' : 'http://';
552+
$install_command = sprintf( 'docker-compose exec --user=\'www-data\' php wp core %s --url=\'%s%s\' --title=\'%s\' --admin_user=\'%s\'', $wp_install_command, $prefix, $this->site_data['site_url'], $this->site_data['app_admin_url'], $this->site_data['app_admin_username'] );
552553
$install_command .= $this->site_data['app_admin_password'] ? sprintf( ' --admin_password=\'%s\'', $this->site_data['app_admin_password'] ) : '';
553554
$install_command .= sprintf( ' --admin_email=\'%s\' %s', $this->site_data['app_admin_email'], $maybe_multisite_type );
554555

@@ -562,7 +563,6 @@ private function install_wp() {
562563
\EE::warning( 'WordPress install failed. Please check logs.' );
563564
}
564565

565-
$prefix = ( $this->site_data['site_ssl'] ) ? 'https://' : 'http://';
566566
\EE::success( $prefix . $this->site_data['site_url'] . ' has been created successfully!' );
567567
}
568568

templates/docker-compose.mustache

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ services:
5353
networks:
5454
site-network:
5555
name: ${VIRTUAL_HOST}
56+
{{#networks_labels}}
57+
labels:
58+
{{#label}}
59+
- "{{name}}"
60+
{{/label}}
61+
{{/networks_labels}}
5662
global-network:
5763
external:
5864
name: ee-global-network

0 commit comments

Comments
 (0)