Skip to content

Commit a32730e

Browse files
committed
Merge remote-tracking branch 'origin/develop' into fix/postfix-configuration
2 parents 5b3765a + b73d8b6 commit a32730e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Site_WP_Docker.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
3535
[ 'name' => 'org.label-schema.vendor=EasyEngine' ],
3636
[ 'name' => 'io.easyengine.site=${VIRTUAL_HOST}' ],
3737
],
38+
'subnet_ip' => $filters['subnet_ip']
3839
],
3940
];
4041

src/WordPress.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ public function __construct() {
258258
*/
259259
public function create( $args, $assoc_args ) {
260260

261-
$this->check_site_count();
262261
\EE\Utils\delem_log( 'site create start' );
263262
$this->logger->debug( 'args:', $args );
264263
$this->logger->debug( 'assoc_args:', empty( $assoc_args ) ? array( 'NULL' ) : $assoc_args );
265-
$this->site_data['site_url'] = strtolower( \EE\Utils\remove_trailing_slash( $args[0] ) );
264+
$this->site_data['site_url'] = strtolower( \EE\Utils\remove_trailing_slash( $args[0] ) );
265+
$this->site_data['subnet_ip'] = \EE\Site\Utils\get_subnet_ip();
266266

267267
$mu = \EE\Utils\get_flag_value( $assoc_args, 'mu' );
268268
$this->site_data['app_sub_type'] = $mu ?? 'wp';
@@ -436,6 +436,7 @@ public function create( $args, $assoc_args ) {
436436
\EE::log( 'Configuring project.' );
437437

438438
$this->create_site( $assoc_args );
439+
439440
\EE\Utils\delem_log( 'site create end' );
440441
}
441442

@@ -828,6 +829,7 @@ public function dump_docker_compose_yml( $additional_filters = [] ) {
828829
$filter['site_prefix'] = \EE_DOCKER::get_docker_style_prefix( $this->site_data['site_url'] );
829830
$filter['php_version'] = ( string ) $this->site_data['php_version'];
830831
$filter['alias_domains'] = implode( ',', array_diff( explode( ',', $this->site_data['alias_domains'] ), [ $this->site_data['site_url'] ] ) );
832+
$filter['subnet_ip'] = $this->site_data['subnet_ip'];
831833
$site_docker = new Site_WP_Docker();
832834

833835
foreach ( $additional_filters as $key => $addon_filter ) {
@@ -1368,10 +1370,10 @@ private function setup_vip( $assoc_args ) {
13681370
* Function to save the site configuration entry into database.
13691371
*/
13701372
private function create_site_db_entry() {
1371-
$ssl = null;
13721373

13731374
$data = [
13741375
'site_url' => $this->site_data['site_url'],
1376+
'subnet_ip' => $this->site_data['subnet_ip'],
13751377
'site_type' => $this->site_data['site_type'],
13761378
'app_admin_url' => $this->site_data['app_admin_url'],
13771379
'app_admin_email' => $this->site_data['app_admin_email'],

templates/docker-compose.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ networks:
8383
{{#label}}
8484
- "{{name}}"
8585
{{/label}}
86+
ipam:
87+
config:
88+
- subnet: '{{subnet_ip}}'
8689
{{/networks_labels}}
8790
global-frontend-network:
8891
external:

0 commit comments

Comments
 (0)